[Twisted-Python] SSHSessionProcessProtocol.inConnectionLost() behavior and Git over Conch
James Y Knight
foom at fuhm.net
Fri Mar 5 10:07:18 MST 2010
On Mar 4, 2010, at 11:51 PM, Michael Hudson-Doyle wrote:
> Maybe
> it's a simple logic error and it method should be
> 'outConnectionClosed' instead?
I'd agree with that. Clearly it should not be sending EOF there for
the server process closing its stdin. One more detail though: you
actually need to wait for both stdout and stderr to close, not just
stdout.
[[[Sidenote:
There *is* no standard SSH protocol message for closing your stdin.
But if openssh 5.1 or later connects to an openssh 5.1 or later
server, it will use the nonstandard eow at openssh.org command to
indicate a closed stdin.
Thus, on standard ssh servers/clients, the command:
ssh hostname yes | true
will hang forever. True closed its stdin by virtue of exiting, but
that can't get propagated across the ssh link. So, yes never gets a
SIGPIPE, and thus never closes its stdout and the command keeps
running forever.
But on openssh 5.1 or greater on both ends, it will "work properly".
BTW, you can't reasonably implement this extension in conch even if
you wanted to, because openssh client will only send it to servers
which identify themselves as openssh servers.
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL
]]]
James
More information about the Twisted-Python
mailing list