Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 95e2d750b941652dad4c688ffc319be3 > files > 14

curl-7.20.1-5.fc13.src.rpm

 lib/ftp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/ftp.c b/lib/ftp.c
index f0a1f24..1741a13 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -415,6 +415,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;
 }