Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions share/tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,14 @@ func (t *Tunnel) BindRemotes(ctx context.Context, remotes []*settings.Remote) er

func (t *Tunnel) keepAliveLoop(sshConn ssh.Conn) {
//ping forever

//reply_timeout set to KeepAlive interval, if KeepAlive is less than 10s, set reply_timeout to 10s
//maybe a new config option for reply_timeout is also fine
reply_timeout := t.Config.KeepAlive

if reply_timeout < 10*time.Second {
reply_timeout = 10 * time.Second
keepAliveInterval := t.Config.KeepAlive
if keepAliveInterval < 5*time.Second {
keepAliveInterval = 5 * time.Second
}

reply_timeout := 2 * time.Second
for {
time.Sleep(t.Config.KeepAlive)
time.Sleep(keepAliveInterval)

errChannel := make(chan error, 2)

Expand Down
Loading