[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libssh2-devel
Subject:    [libssh2] [ libssh2-Bugs-2141548 ] libssh2_poll detects data on
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2008-10-02 2:22:04
Message-ID: E1KlDpM-0003ce-6k () d45xhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #2141548, was opened at 2008-10-01 21:11
Message generated for change (Comment added) made by thomaspu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2141548&group_id=125852

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: libssh2_poll detects data on channel, but no data available

Initial Comment:
I've got a small home-brewed SSH client and I've encountered a problem in the library \
with libssh2_poll() when checking for data on a channel.

Simply put, here's the setup. I have a thread that polls for data on a channel every \
few usec. When the libssh2_poll function detects data available to be read on the \
channel I'm interested in, I immediately try to read from that channel. Trouble is, \
if its a small piece of data that I'm expecting, the read fails while subsequent \
polls still think that there is data there.

So In my SSH client with a pty, I do something like hit the "z" key. This should send \
a single character over the lines to the remote SSH server plus any SSH/TCP/IP.... \
overhead. Now the remote SSH server will echo back the key plus any additional \
terminal formatting.

As soon as I hit my "z" key, libssh2_poll alerts me that data is available to be read \
from the channel, but attempting to read from the channel doesn't read any \
data...polling keeps saying theres data, I read nothing... repeat a lot of times...

If I keep hitting keystrokes, eventually the channel read picks up the data. So it \
seems like libssh2 holds onto small packets for some reason.


----------------------------------------------------------------------

Comment By: Paul Thomas (thomaspu)
Date: 2008-10-01 21:22

Message:
I think the problem stems around line 1525 of channel.c. Looks like if we
call the channel_read function, we expect to read data from a call to
libssh2_packet_read() and if we don't read anything from that function
call, we don;t read anything period. However, the code doesn't check the
packet list to see if there's packets in it waiting to be read.

----------------------------------------------------------------------

Comment By: Paul Thomas (thomaspu)
Date: 2008-10-01 21:12

Message:
This one was written up by me, I just forgot to log in again!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2141548&group_id=125852

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic