]> granicus.if.org Git - curl/commitdiff
ftp: fix wrong poll on the secondary socket
authorAles Novak <alnovak@suse.cz>
Tue, 23 Aug 2016 12:13:18 +0000 (14:13 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 23 Aug 2016 13:31:07 +0000 (15:31 +0200)
When we're uploading using FTP and the server issues a tiny pause
between opening the connection to the client's secondary socket, the
client's initial poll() times out, which leads to second poll() which
does not wait for POLLIN on the secondary socket. So that poll() also
has to time out, creating a long (200ms) pause.

This patch adds the correct flag to the secondary socket, making the
second poll() correctly wait for the connection there too.

Signed-off-by: Ales Novak <alnovak@suse.cz>
Closes #978

lib/ftp.c

index 8af6531588d1a35bc2cd53f226e4499a4261f777..5aa9605d0add10d65b5749e14d78c3895992f87d 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -911,7 +911,7 @@ static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks,
     }
     else {
       socks[1] = conn->sock[SECONDARYSOCKET];
-      bits |= GETSOCK_WRITESOCK(1);
+      bits |= GETSOCK_WRITESOCK(1) | GETSOCK_READSOCK(1);
     }
 
     return bits;