aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-11-09 17:04:04 +0100
committerKamil Dudka <kdudka@redhat.com>2010-11-09 18:13:20 +0100
commit12b2412c5217b105a86ccda57f261a33fcfd4d62 (patch)
treee9ffa6bee1a750defa57fc5cb4c1f18ebb9c73bf /lib/ftp.c
parent7d8343934be38c196ae02ac0516580dc98cceb87 (diff)
ftp: treat server's response 421 as CURLE_OPERATION_TIMEDOUT
Bug: https://bugzilla.redhat.com/650255 Reported by: Simon H.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index d79878e82..416e5ecfa 100644
--- 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;
}