fix kcp option
This commit is contained in:
parent
9fa95cc8b3
commit
1117723913
@ -149,7 +149,9 @@ func (d *kcpDialer) initSession(ctx context.Context, addr net.Addr, conn net.Pac
|
||||
smuxConfig.Version = config.SmuxVer
|
||||
smuxConfig.MaxReceiveBuffer = config.SmuxBuf
|
||||
smuxConfig.MaxStreamBuffer = config.StreamBuf
|
||||
smuxConfig.KeepAliveInterval = time.Duration(config.KeepAlive) * time.Second
|
||||
if config.KeepAlive > 0 {
|
||||
smuxConfig.KeepAliveInterval = time.Duration(config.KeepAlive) * time.Second
|
||||
}
|
||||
var cc net.Conn = kcpconn
|
||||
if !config.NoComp {
|
||||
cc = kcp_util.CompStreamConn(kcpconn)
|
||||
|
@ -160,7 +160,9 @@ func (l *kcpListener) mux(conn net.Conn) {
|
||||
smuxConfig.Version = l.md.config.SmuxVer
|
||||
smuxConfig.MaxReceiveBuffer = l.md.config.SmuxBuf
|
||||
smuxConfig.MaxStreamBuffer = l.md.config.StreamBuf
|
||||
smuxConfig.KeepAliveInterval = time.Duration(l.md.config.KeepAlive) * time.Second
|
||||
if l.md.config.KeepAlive > 0 {
|
||||
smuxConfig.KeepAliveInterval = time.Duration(l.md.config.KeepAlive) * time.Second
|
||||
}
|
||||
|
||||
if !l.md.config.NoComp {
|
||||
conn = kcp_util.CompStreamConn(conn)
|
||||
|
Loading…
Reference in New Issue
Block a user