File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,6 @@ func (srv *Server) ensureHostSigner() error {
56
56
}
57
57
58
58
func (srv * Server ) config (ctx Context ) * gossh.ServerConfig {
59
- srv .channelHandlers = map [string ]channelHandler {
60
- "session" : sessionHandler ,
61
- "direct-tcpip" : directTcpipHandler ,
62
- }
63
59
config := & gossh.ServerConfig {}
64
60
for _ , signer := range srv .HostSigners {
65
61
config .AddHostKey (signer )
@@ -164,6 +160,12 @@ func (srv *Server) Serve(l net.Listener) error {
164
160
if srv .Handler == nil {
165
161
srv .Handler = DefaultHandler
166
162
}
163
+ if srv .channelHandlers == nil {
164
+ srv .channelHandlers = map [string ]channelHandler {
165
+ "session" : sessionHandler ,
166
+ "direct-tcpip" : directTcpipHandler ,
167
+ }
168
+ }
167
169
var tempDelay time.Duration
168
170
169
171
srv .trackListener (l , true )
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ func (srv *Server) serveOnce(l net.Listener) error {
18
18
if e != nil {
19
19
return e
20
20
}
21
+ srv .channelHandlers = map [string ]channelHandler {
22
+ "session" : sessionHandler ,
23
+ "direct-tcpip" : directTcpipHandler ,
24
+ }
21
25
srv .handleConn (conn )
22
26
return nil
23
27
}
You can’t perform that action at this time.
0 commit comments