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.Version = config.SmuxVer
|
||||||
smuxConfig.MaxReceiveBuffer = config.SmuxBuf
|
smuxConfig.MaxReceiveBuffer = config.SmuxBuf
|
||||||
smuxConfig.MaxStreamBuffer = config.StreamBuf
|
smuxConfig.MaxStreamBuffer = config.StreamBuf
|
||||||
|
if config.KeepAlive > 0 {
|
||||||
smuxConfig.KeepAliveInterval = time.Duration(config.KeepAlive) * time.Second
|
smuxConfig.KeepAliveInterval = time.Duration(config.KeepAlive) * time.Second
|
||||||
|
}
|
||||||
var cc net.Conn = kcpconn
|
var cc net.Conn = kcpconn
|
||||||
if !config.NoComp {
|
if !config.NoComp {
|
||||||
cc = kcp_util.CompStreamConn(kcpconn)
|
cc = kcp_util.CompStreamConn(kcpconn)
|
||||||
|
@ -160,7 +160,9 @@ func (l *kcpListener) mux(conn net.Conn) {
|
|||||||
smuxConfig.Version = l.md.config.SmuxVer
|
smuxConfig.Version = l.md.config.SmuxVer
|
||||||
smuxConfig.MaxReceiveBuffer = l.md.config.SmuxBuf
|
smuxConfig.MaxReceiveBuffer = l.md.config.SmuxBuf
|
||||||
smuxConfig.MaxStreamBuffer = l.md.config.StreamBuf
|
smuxConfig.MaxStreamBuffer = l.md.config.StreamBuf
|
||||||
|
if l.md.config.KeepAlive > 0 {
|
||||||
smuxConfig.KeepAliveInterval = time.Duration(l.md.config.KeepAlive) * time.Second
|
smuxConfig.KeepAliveInterval = time.Duration(l.md.config.KeepAlive) * time.Second
|
||||||
|
}
|
||||||
|
|
||||||
if !l.md.config.NoComp {
|
if !l.md.config.NoComp {
|
||||||
conn = kcp_util.CompStreamConn(conn)
|
conn = kcp_util.CompStreamConn(conn)
|
||||||
|
Loading…
Reference in New Issue
Block a user