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

delayed_close always activated in channel_rcv_close when exiting an ssh shell session


Hi

I recently completed a prototype x509 ssh client built on top of libssh for the Windows command prompt. It consists of a basic event loop which checks for data off stdin and the ssh shell channel. It sleeps in intervals of 20 milliseconds and loops as long as the channel is not closed. Other than the limited terminal capabilities of the windows console, it works great. The only problem I encounter is on exit.

When I type 'exit', the remote ssh server shuts down the channel and waits for my libssh client to do likewise. What I find is that when the channel close packet is recv'd, the function "channel_rcv_close" always places the channel in a "delayed_close" state because it detects data in the channel stdout buffer. My initial understanding was that the channel state would be updated once the data has been transmitted but this is not so. Currently, I can only detect if the channel has closed when the 'ssh_channel_poll' function returns an SSH_EOF.

Is this a bug or a feature? :), any insight is appreciated.

- Gearoid

Archive administrator: postmaster@lists.cynapses.org