Fix panic
This commit is contained in:
parent
bca2dabbb7
commit
69db192f6c
1 changed files with 3 additions and 1 deletions
|
|
@ -99,7 +99,9 @@ func NewSSHSessionWithDelayedTimeout(ctx context.Context, timeout time.Duration,
|
||||||
go func() {
|
go func() {
|
||||||
select {
|
select {
|
||||||
case <-time.After(timeout):
|
case <-time.After(timeout):
|
||||||
|
if preTimeout != nil {
|
||||||
preTimeout()
|
preTimeout()
|
||||||
|
}
|
||||||
timedOut = true
|
timedOut = true
|
||||||
_ = sc.Close()
|
_ = sc.Close()
|
||||||
case <-done:
|
case <-done:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue