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.
This commit is contained in:
Gokhan Sengun 2011-12-19 14:35:20 +01:00 committed by Daniel Stenberg
parent 5527417afa
commit c834213ad5
20 changed files with 366 additions and 132 deletions

View file

@ -1388,6 +1388,13 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
break;
case CURLM_STATE_DO_DONE:
if(easy->easy_conn->bits.wait_data_conn == TRUE) {
multistate(easy, CURLM_STATE_DO_MORE);
result = CURLM_OK;
break;
}
/* Move ourselves from the send to recv pipeline */
moveHandleFromSendToRecvPipeline(data, easy->easy_conn);
/* Check if we can move pending requests to send pipe */