cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl_sftp_send()

From: James Housley <jim_at_thehousleys.net>
Date: Tue, 17 Apr 2007 20:06:01 -0400

I see Curl_sftp_recv() uses the non-blocking calls, this will do the
same for Curl_sftp_send()

Jim

Index: lib/ssh.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/ssh.c,v
retrieving revision 1.29
diff -u -r1.29 ssh.c
--- lib/ssh.c 8 Apr 2007 22:44:21 -0000 1.29
+++ lib/ssh.c 17 Apr 2007 23:50:12 -0000
@@ -1021,9 +1021,15 @@
    ssize_t nwrite;
    /* libssh2_sftp_write() returns size_t !*/
-
+
+#ifdef LIBSSH2SFTP_EAGAIN
+ /* 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);
+#else
    nwrite = (ssize_t)
      libssh2_sftp_write(conn->data->reqdata.proto.ssh->sftp_handle,
mem, len);
+#endif
    (void)sockindex;
    return nwrite;
}

--
/"\   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
---------------------------------------------------------------------
In theory there is no difference between theory and practice.
In practice there is no similarity.
       -- From the "I wish I'd said that" archives.
Received on 2007-04-18