]> granicus.if.org Git - curl/commitdiff
ftp: treat server's response 421 as CURLE_OPERATION_TIMEDOUT
authorKamil Dudka <kdudka@redhat.com>
Tue, 9 Nov 2010 16:04:04 +0000 (17:04 +0100)
committerKamil Dudka <kdudka@redhat.com>
Tue, 9 Nov 2010 17:13:20 +0000 (18:13 +0100)
Bug: https://bugzilla.redhat.com/650255
Reported by: Simon H.

RELEASE-NOTES
lib/ftp.c

index 2ade98a002d4548b39ff325c5051a616213b75f3..f7348661404a80b0e6d3e9dff560c6f6a5e9c1d2 100644 (file)
@@ -24,6 +24,7 @@ This release includes the following bugfixes:
  o ftp: prevent server from hanging on closed data connection when stopping
    a transfer before the end of the full transfer (ranges)
  o LDAP: detect non-binary attributes properly
+ o ftp: treat server's response 421 as CURLE_OPERATION_TIMEDOUT
 
 This release includes the following known bugs:
 
index d79878e82d84ea4792aaba308b33e8bde86f39a4..416e5ecfa3777fc1d4797448c5fb62696615fcea 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -425,6 +425,12 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
   if(ftpcode)
     *ftpcode = code;
 
+  if(421 == code)
+    /* 421 means "Service not available, closing control connection." and FTP
+     * servers use it to signal that idle session timeout has been exceeded.
+     * If we ignored the response, it could end up hanging in some cases. */
+    return CURLE_OPERATION_TIMEDOUT;
+
   return result;
 }