aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-04-05 08:39:24 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-04-06 17:21:38 +0200
commit57aeabcc1a20ff8ed1d725ef0309d0d8f64194d8 (patch)
treeead4ebe82afaf0c9143a6b211556fbefca042608 /lib
parent9474c4a9a5828291fc3c1157b8536031d3fa4cac (diff)
FTP: wait on both connections during active STOR state
When doing PORT and upload (STOR), this function needs to extract the file descriptor for both connections so that it will respond immediately when the server eventually connects back. This flaw caused active connections to become unnecessary slow but they would still often work due to the normal polling on a timeout. The bug also would not occur if the server connected back very fast, like when testing on local networks. Bug: http://curl.haxx.se/bug/view.cgi?id=1183 Reported by: Daniel Theron
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index e490dd206..0b2e5cce4 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -878,14 +878,16 @@ static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks,
remote site, or we could wait for that site to connect to us. Or just
handle ordinary commands.
- When waiting for a connect, we will be in FTP_STOP state and then we wait
- for the secondary socket to become writeable. If we're in another state,
- we're still handling commands on the control (primary) connection.
+ When waiting for a connect, we can be in FTP_STOP state (or we're in
+ FTP_STOR when we do an upload) and then we wait for the secondary socket
+ to become writeable. . If we're in another state, we're still handling
+ commands on the control (primary) connection.
*/
switch(ftpc->state) {
case FTP_STOP:
+ case FTP_STOR:
break;
default:
return Curl_pp_getsock(&conn->proto.ftpc.pp, socks, numsocks);