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

List:       libssh2-devel
Subject:    [libssh2] recent change in channel_read_ex
From:       "E L" <crc1021 () gmail ! com>
Date:       2008-10-20 16:47:42
Message-ID: 1233bfe30810200947v17f54b7fibd4b3c4247d742fe () mail ! gmail ! com
[Download RAW message or body]

There was change in libssh2_channel_read_ex, in the check of rc < 0
        if (channel->read_block) {
            /* in the second lap and onwards, do this */
            rc = libssh2_packet_read(session);
            channel->read_packet = session->packets.head;
        }

        /* We didn't read any data from the socket and
         * no packets are waiting to be read */
        if ((rc < 0) && (! channel->read_packet)) {
		    if (rc != PACKET_EAGAIN) {
                channel->read_state = libssh2_NB_state_idle;
            }
            /* no packets available */
            return rc;
        }

This is causing problems for me, the code appears to spin in some busy
wait loop.

This issue is that rc == LIBSSH2_ERROR_EAGAIN and
session->packets.head is not NULL, so the error checking code is not
entered.  Reverting that line by removing the "&& (!
channel->read_packet)", make the code work again.

Code is from libssh2-0.19.0-20081020, compiled with mingw on win XP,
and used in libcurl.

-------------------------------------------------------------------------
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