diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-10-21 23:36:54 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-10-21 23:36:54 +0200 |
commit | d7934b8bd49114cbb54f7401742f7fb088e2f796 (patch) | |
tree | 35beaeb7e2050d89bb2b59b85f2d25d177e63d39 /lib/http.c | |
parent | d67b75c9f9c59ea4adc40d0b333c6047621573ba (diff) |
curl_multi_fdset: correct fdset with FTP PORT use
After a PORT has been issued, and the multi handle would switch to the
CURLM_STATE_DO_MORE state (which is unique for FTP), libcurl would
return the wrong fdset to wait for when curl_multi_fdset() is
called. The code would blindly assume that it was waiting for a connect
of the second connection, while that isn't true immediately after the
PORT command.
Also, the function multi.c:domore_getsock() was highly FTP-centric and
therefore ugly to keep in protocol-agnostic code. I solved this problem
by introducing a new function pointer in the Curl_handler struct called
domore_getsock() which is only called during the DOMORE state for
protocols that set that pointer.
The new ftp.c:ftp_domore_getsock() function now returns fdset info about
the control connection's command/response handling while such a state is
in use, and goes over to waiting for a writable second connection first
once the commands are done.
The original problem could be seen by running test 525 and checking the
time stamps in the FTP server log. I can verify that this fix at least
fixes this problem.
Bug: http://curl.haxx.se/mail/lib-2011-10/0250.html
Reported by: Gokhan Sengun
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/http.c b/lib/http.c index e41cb7af3..f85cd6c55 100644 --- a/lib/http.c +++ b/lib/http.c @@ -118,6 +118,7 @@ const struct Curl_handler Curl_handler_http = { ZERO_NULL, /* doing */ ZERO_NULL, /* proto_getsock */ http_getsock_do, /* doing_getsock */ + ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ @@ -141,6 +142,7 @@ const struct Curl_handler Curl_handler_https = { ZERO_NULL, /* doing */ https_getsock, /* proto_getsock */ http_getsock_do, /* doing_getsock */ + ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* readwrite */ |