IETF-SSH archive

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

Re: closing a channel



On Sat, Mar 23, 2002 at 08:58:13AM +0100, Niels Möller wrote:
> > 1. CHANNEL_EOF has been sent by this side (i.e. this side has no more data
> > or requests to send)
> > 2. CHANNEL_EOF has been received from the other side, or this side cannot
> > process any more incoming channel data or requests.
> 
> Consider the
> 
>   ssh host cat foo
> 
> case. I'm afraid your simple rules are not sufficient (and I have
> actually implemented them).

Maybe you didn't notice that condition 2 has two parts. If the child
process (cat in this case) terminates, then this side cannot process any
more incoming channel data or requests, so condition 2 is satisfied.

But I can see why you want to make CHANNEL_EOF independent from
CHANNEL_REQUEST, and also why Markus wants to make CHANNEL_EOF independent
from both CHANNEL_EXTENDED_DATA and CHANNEL_REQUEST.

What do you think about this proposal: link CHANNEL_EOF to all of
CHANNEL_DATA, CHANNEL_EXTENDED_DATA, and CHANNEL_REQUEST, and create two
new channel message types: CHANNEL_DATA_END, linked only to CHANNEL_DATA,
and CHANNEL_EXTENDED_DATA_END, linked only to CHANNEL_EXTENDED_DATA.
CHANNEL_EXTENDED_DATA_END would look like this:

     byte      SSH_MSG_CHANNEL_EXTENDED_DATA_END
     uint32    recipient_channel
     uint32    data_type_code

so there would be one CHANNEL_EXTENDED_DATA_END for each type of
extended data.

Then, CHANNEL_EOF would be used to determine when to close the channel,
and CHANNEL_DATA_END and CHANNEL_EXTENDED_DATA_END would be used to tell
the other side to close the corresponding fds.



Home | Main Index | Thread Index | Old Index