]> source.dussan.org Git - gitea.git/commitdiff
Fix #2431 - handle requests waiting for reply
authorDmitry Neverov <dmitry.neverov@gmail.com>
Mon, 18 Jan 2016 15:52:38 +0000 (16:52 +0100)
committerDmitry Neverov <dmitry.neverov@gmail.com>
Mon, 18 Jan 2016 15:54:10 +0000 (16:54 +0100)
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

modules/ssh/ssh.go

index 15ba02a2b12e62833cbc53032caa2f99c6f1a720..41a87066309ba2e02349204a2aab0a0f539fdc33 100644 (file)
@@ -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)