Skip to content

Commit 083bdec

Browse files
authored
Merge branch 'master' into RDODCP-912
2 parents 0510fc9 + adec94b commit 083bdec

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

share/tunnel/tunnel.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,14 @@ func (t *Tunnel) BindRemotes(ctx context.Context, remotes []*settings.Remote) er
177177

178178
func (t *Tunnel) keepAliveLoop(sshConn ssh.Conn) {
179179
//ping forever
180-
181-
//reply_timeout set to KeepAlive interval, if KeepAlive is less than 10s, set reply_timeout to 10s
182-
//maybe a new config option for reply_timeout is also fine
183-
reply_timeout := t.Config.KeepAlive
184-
185-
if reply_timeout < 10*time.Second {
186-
reply_timeout = 10 * time.Second
180+
keepAliveInterval := t.Config.KeepAlive
181+
if keepAliveInterval < 5*time.Second {
182+
keepAliveInterval = 5 * time.Second
187183
}
188184

185+
reply_timeout := 2 * time.Second
189186
for {
190-
time.Sleep(t.Config.KeepAlive)
187+
time.Sleep(keepAliveInterval)
191188

192189
errChannel := make(chan error, 2)
193190

0 commit comments

Comments
 (0)