浏览代码

Fix #2431 - handle requests waiting for reply

According to the docs [1], the Reply method must be called for all
requests where WantReply is true. This fixes a hanging java ssh
implementation (jsch) which sets WantReply flag and waits for reply from
the server.

[1] https://godoc.org/golang.org/x/crypto/ssh#Request.Reply
Dmitry Neverov 9 年之前
父节点
当前提交
fb99d50fa1
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      modules/ssh/ssh.go

+ 1 - 0
modules/ssh/ssh.go

@@ -91,6 +91,7 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
 						return
 					}
 
+					req.Reply(true, nil);
 					go io.Copy(input, ch)
 					io.Copy(ch, stdout)
 					io.Copy(ch.Stderr(), stderr)