File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -926,17 +926,18 @@ func (e *Engine) updateSSH(sshConf *mgmProto.SSHConfig) error {
926926 listenAddr = fmt .Sprintf ("127.0.0.1:%d" , nbssh .DefaultSSHPort )
927927 }
928928 // nil sshServer means it has not yet been started
929- var err error
930- e .sshServer , err = e .sshServerFunc (e .config .SSHKey , listenAddr )
931-
929+ server , err := e .sshServerFunc (e .config .SSHKey , listenAddr )
932930 if err != nil {
933931 e .sshMux .Unlock ()
934932 return fmt .Errorf ("create ssh server: %w" , err )
935933 }
934+
935+ e .sshServer = server
936936 e .sshMux .Unlock ()
937+
937938 go func () {
938939 // blocking
939- err = e . sshServer .Start ()
940+ err = server .Start ()
940941 if err != nil {
941942 // will throw error when we stop it even if it is a graceful stop
942943 log .Debugf ("stopped SSH server with error %v" , err )
You can’t perform that action at this time.
0 commit comments