cURL / Mailing Lists / curl-library / Single Mail

curl-library

libssh2 is now fully non-blocking

From: James Housley <jim_at_thehousleys.net>
Date: Thu, 7 Jun 2007 13:02:40 -0400

The version of libssh2 in CVS is now fully non-blocking. That means
there is a lot of work to be done to make ssh.c function properly
again. Below is the minimum patch needed so it will compile again.

Jim

Index: lib/ssh.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/ssh.c,v
retrieving revision 1.34
diff -u -r1.34 ssh.c
--- lib/ssh.c 15 May 2007 00:28:50 -0000 1.34
+++ lib/ssh.c 7 Jun 2007 16:59:06 -0000
@@ -656,7 +656,7 @@
     * NOTE: we should not store nor rely on connection-related data
to be
     * in the SessionHandle struct
     */
-#ifdef LIBSSH2CHANNEL_EAGAIN
+#if defined(LIBSSH2CHANNEL_EAGAIN) && (LIBSSH2_APINO < 200706012030)
    nwrite = (ssize_t)
      libssh2_channel_writenb(conn->data->reqdata.proto.ssh-
>ssh_channel,
                              mem, len);
@@ -685,7 +685,7 @@
     * in the SessionHandle struct
     */
-#ifdef LIBSSH2CHANNEL_EAGAIN
+#if defined(LIBSSH2CHANNEL_EAGAIN) && (LIBSSH2_APINO < 200706012030)
    /* we prefer the non-blocking API but that didn't exist
previously */
    nread = (ssize_t)
      libssh2_channel_readnb(conn->data->reqdata.proto.ssh->ssh_channel,
@@ -1034,7 +1034,7 @@
    ssize_t nwrite; /* libssh2_sftp_write() used to return size_t
in 0.14
                         but is changed to ssize_t in 0.15! */
-#ifdef LIBSSH2SFTP_EAGAIN
+#if defined(LIBSSH2SFTP_EAGAIN) && (LIBSSH2_APINO < 200706012030)
    /* we prefer the non-blocking API but that didn't exist
previously */
    nwrite = (ssize_t)
      libssh2_sftp_writenb(conn->data->reqdata.proto.ssh-
>sftp_handle, mem, len);
@@ -1381,7 +1381,7 @@
    /* libssh2_sftp_read() returns size_t !*/
-#ifdef LIBSSH2SFTP_EAGAIN
+#if defined(LIBSSH2SFTP_EAGAIN) && (LIBSSH2_APINO < 200706012030)
    /* we prefer the non-blocking API but that didn't exist
previously */
    nread = (ssize_t)
      libssh2_sftp_readnb(conn->data->reqdata.proto.ssh->sftp_handle,
mem, len);

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
Progress (n) : What led from smart users in front of dumb terminals to
dumb users in front of smart terminals.
Received on 2007-06-07