From bc89c496413265e715159bdc8478ee9a92fdc265 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 8 Jul 2016 13:45:45 +0200 Subject: [PATCH] ssh: clarify error type if a SendRequest goes unanswered This came up in the discussion of issue #16194. Change-Id: Ibb4cadf3be975377819eca2e41e0992794ada77b Reviewed-on: https://go-review.googlesource.com/24820 Reviewed-by: Brad Fitzpatrick Run-TryBot: Han-Wen Nienhuys TryBot-Result: Gobot Gobot --- ssh/channel.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssh/channel.go b/ssh/channel.go index 6671c98..6d709b5 100644 --- a/ssh/channel.go +++ b/ssh/channel.go @@ -67,6 +67,8 @@ type Channel interface { // boolean, otherwise the return value will be false. Channel // requests are out-of-band messages so they may be sent even // if the data stream is closed or blocked by flow control. + // If the channel is closed before a reply is returned, io.EOF + // is returned. SendRequest(name string, wantReply bool, payload []byte) (bool, error) // Stderr returns an io.ReadWriter that writes to this channel