IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: closing a channel



> CHANNEL_DATA "foo\n"
> CHANNEL_EOF
> ... delay of about 30 seconds ...
> CHANNEL_REQUEST "exit-status" 17
> CHANNEL_CLOSE

This looks very reasonable. Does your server behave the same if the client
sends EOF immediately after issuing the exec request? That's what my clients
do - when issuing an exec request, they let the server know immediately that
they're not going to send any data.

I find it problematic that the specification doesn't say who is supposed to
close the session channel. Can the client rely on the server closing the
channel after the child process exits? If not, can the client rely on the
server sending an 'exit-status' message?

Since the draft's wording about 'exit-status' is that its use is only
"recommended", and since the draft doesn't say anything about the server
closing the channel when the child process terminates, my implementation
currently assumes that it cannot rely on any of that. So, preferring to be
safe than sorry, it automatically closes the channel after EOF has been both
sent and received.

But if I knew that I can rely on the server to send 'exit-status' or to
close the channel upon child process termination, I would prefer not to rush
with my own CHANNEL_CLOSE so that I can possibly catch the program's exit
code.





Home | Main Index | Thread Index | Old Index