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

Re: channel_select blocks until data received, despite timeout. message 3 of 20)

Honestly, 0.4.0 release. channels.c (in which the issue occurs) has not been updated in regards to this. There is another issue, the reason why I used channel_select: on Windows, channel_poll won't get new data that's on the wire. This function calls ssh_handle_packets, which calls ssh_socket_poll, ssh_poll, poll_rest, which has a call to WaitForMultipleObjectsEx(nhandles, handles, FALSE, timeout, TRUE);.

Timeout is set 0 in the call to poll_rest, and WaitForMultipleObjectsEx appears to return immediately -- WITHOUT processing new wire data. The effect is the channel (nothing, really) receives any new data. The workaround: instead of doing channel_poll, I can do a channel_select, specify a 1 microsecond timeout, it will get new data and return for me. The problem reported occurs if there is no new data. Easy enough to make channel_select not loop at all.


Aris Adamantiadis - aris@xxxxxxxxxxxx wrote:
Hi Andrew,

Which release/version of libssh did you try ? I will check and correct
this if needed.

Andreas: Could you check/remove the spam filter ? This is not the first
time it happens.



libssh.20.awinder@xxxxxxxxxxxxxxx a écrit :
channel_select allows a timeout value to be specified. This timeout is
used in the select() call, however is not honored because the code
requires data to be available on the channel before channel_select returns.

channels.c, starting line 2196.

First, the channels are polled. If no data is received, the code goes on
to block with select() using the given timeout. When select returnes,
the code loops back around to check for data on one of the requested
channels, and if there is none, continues on to the select() using the
given timeout. When select returns, ....

When trying to create a bug report: Submission rejected as potential
spam (Akismet says content is spam)


channel_select blocks until data received, despite timeout.libssh.20.awinder@xxxxxxxxxxxxxxx
Re: channel_select blocks until data received, despite timeout.Aris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org