diff options
author | Gokhan Sengun <gokhansengun@gmail.com> | 2011-12-19 14:35:20 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-12-20 20:30:02 +0100 |
commit | c834213ad52c52431e9ca597862dc81839cabe84 (patch) | |
tree | 678dfd82d3129b8aef8a0222defc55244003203b /lib/url.c | |
parent | 5527417afae062d7a2b12ee80730a0ab22b86eab (diff) | |
download | curl-c834213ad52c52431e9ca597862dc81839cabe84.tar.gz |
FTP: perform active connections non-blocking
1- Two new error codes are introduced.
CURLE_FTP_ACCEPT_FAILED to be set whenever ACCEPTing fails because of
FTP server connected.
CURLE_FTP_ACCEPT_TIMEOUT to be set whenever ACCEPTing timeouts.
Neither of these errors are considered fatal and control connection
remains OK because it could just be a firewall blocking server to
connect to the client.
2- One new setopt option was introduced.
CURLOPT_ACCEPTTIMEOUT_MS
It sets the maximum amount of time FTP client is going to wait for a
server to connect. Internal default accept timeout is 60 seconds.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1677,6 +1677,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, data->set.connecttimeout = va_arg(param, long); break; + case CURLOPT_ACCEPTTIMEOUT_MS: + /* + * The maximum time you allow curl to wait for server connect + */ + data->set.accepttimeout = va_arg(param, long); + break; + case CURLOPT_USERPWD: /* * user:password to use in the operation @@ -5457,7 +5464,7 @@ CURLcode Curl_do_more(struct connectdata *conn) if(conn->handler->do_more) result = conn->handler->do_more(conn); - if(result == CURLE_OK) + if(result == CURLE_OK && conn->bits.wait_data_conn == FALSE) /* do_complete must be called after the protocol-specific DO function */ do_complete(conn); |