From c834213ad52c52431e9ca597862dc81839cabe84 Mon Sep 17 00:00:00 2001 From: Gokhan Sengun Date: Mon, 19 Dec 2011 14:35:20 +0100 Subject: 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. --- lib/strerror.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/strerror.c') diff --git a/lib/strerror.c b/lib/strerror.c index fcb617cf2..4aa125735 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -81,6 +81,12 @@ curl_easy_strerror(CURLcode error) case CURLE_REMOTE_ACCESS_DENIED: return "Access denied to remote resource"; + case CURLE_FTP_ACCEPT_FAILED: + return "FTP: The server failed to connect to data port"; + + case CURLE_FTP_ACCEPT_TIMEOUT: + return "FTP: Accepting server connect has timed out"; + case CURLE_FTP_PRET_FAILED: return "FTP: The server did not accept the PRET command."; @@ -284,8 +290,6 @@ curl_easy_strerror(CURLcode error) return "Chunk callback failed"; /* error codes not used by current libcurl */ - case CURLE_OBSOLETE10: - case CURLE_OBSOLETE12: case CURLE_OBSOLETE16: case CURLE_OBSOLETE20: case CURLE_OBSOLETE24: -- cgit v1.2.1