diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-12-20 12:52:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-12-20 20:30:02 +0100 |
commit | dfdac61522c7d660f884ec7a663dedb2d69d16a8 (patch) | |
tree | 18fb71b132893a5bc84324002830bddb56b70309 /lib/url.c | |
parent | c834213ad52c52431e9ca597862dc81839cabe84 (diff) | |
download | curl-dfdac61522c7d660f884ec7a663dedb2d69d16a8.tar.gz |
non-blocking active FTP: cleanup multi state usage
Backpedaled out the funny double-change of state in the multi state
machine by adding a new argument to the do_more() function to signal
completion. This way it can remain in the DO_MORE state properly until
done. Long term, the entire DO_MORE logic should be moved into the FTP
code and be hidden from the multi code as the logic is only used for
FTP.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -5457,14 +5457,25 @@ CURLcode Curl_do(struct connectdata **connp, bool *done) return result; } -CURLcode Curl_do_more(struct connectdata *conn) +/* + * Curl_do_more() is called during the DO_MORE multi state. It is basically a + * second stage DO state which (wrongly) was introduced to support FTP's + * second connection. + * + * TODO: A future libcurl should be able to work away this state. + * + */ + +CURLcode Curl_do_more(struct connectdata *conn, bool *completed) { CURLcode result=CURLE_OK; + *completed = FALSE; + if(conn->handler->do_more) - result = conn->handler->do_more(conn); + result = conn->handler->do_more(conn, completed); - if(result == CURLE_OK && conn->bits.wait_data_conn == FALSE) + if(!result && completed) /* do_complete must be called after the protocol-specific DO function */ do_complete(conn); |