Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyan2008 committed Jun 18, 2021
1 parent 62e410e commit ff98b0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ssh/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ func NewForward(httpCtx *hfw.HTTPContext, t ForwardType, sshConfig SSHConfig, fi
err = l.Bind(fi)
if err != nil {
l.c.Close()
return
}
l.httpCtx.Infof("Bind %s forward to %s success, start to accept", l.lister.Addr().String(), fi.Addr)
l.Accept()
} else {
l.c.Close()
return
}

return
Expand Down Expand Up @@ -90,10 +94,6 @@ func (l *Forward) Bind(fi *ForwardIni) (err error) {
} else if l.t == REMOTE {
l.lister, err = l.c.Listen(l.fi.Bind)
}
if err == nil {
l.httpCtx.Infof("Bind %s forward to %s success, start to accept", l.lister.Addr().String(), fi.Addr)
go l.Accept()
}
} else {
return errors.New("Err ForwardIni")
}
Expand Down

0 comments on commit ff98b0a

Please sign in to comment.