]> granicus.if.org Git - curl/commitdiff
ssh_statemach_act: set cselect for sftp upload
authorDaniel Stenberg <daniel@haxx.se>
Sun, 13 Mar 2011 13:10:27 +0000 (14:10 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 13 Mar 2011 13:10:27 +0000 (14:10 +0100)
For uploads we want to use the _sending_ function even when the socket
turns out readable as the underlying libssh2 sftp send function will
deal with both accordingly. This is what the cselect_bits magic is for.

Fixes test 582.

lib/ssh.c

index 434b80d06ae607923ca659165bd4feeaba67b0e8..118611efcbc87a30dce2831100d38c6ca5b7bdab 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1599,6 +1599,11 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
            figure out a "real" bitmask */
         sshc->orig_waitfor = data->req.keepon;
 
+        /* we want to use the _sending_ function even when the socket turns
+           out readable as the underlying libssh2 sftp send function will deal
+           with both accordingly */
+        conn->cselect_bits = CURL_CSELECT_OUT;
+
         /* since we don't really wait for anything at this point, we want the
            state machine to move on as soon as possible so we set a very short
            timeout here */