]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1348: Some odd FTP servers respond with 250 where 226 is expected
authorserassio <>
Sat, 3 Sep 2005 16:09:09 +0000 (16:09 +0000)
committerserassio <>
Sat, 3 Sep 2005 16:09:09 +0000 (16:09 +0000)
Forward port of 2.5 patch.

src/ftp.cc

index 0efcd00e3172e59845aa65b49d1e2879d0bdca92..992d9eabfe6bc6f31cba0ca4c66b689fe56fdc02 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.363 2005/06/26 17:12:47 serassio Exp $
+ * $Id: ftp.cc,v 1.364 2005/09/03 10:09:09 serassio Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -2699,7 +2699,7 @@ ftpReadTransferDone(FtpStateData * ftpState)
     int code = ftpState->ctrl.replycode;
     debug(9, 3) ("This is ftpReadTransferDone\n");
 
-    if (code == 226) {
+    if (code == 226 || code == 250) {
         /* Connection closed; retrieval done. */
 
         if (ftpState->flags.html_header_sent)
@@ -2773,7 +2773,7 @@ ftpWriteTransferDone(FtpStateData * ftpState)
     int code = ftpState->ctrl.replycode;
     debug(9, 3) ("This is ftpWriteTransferDone\n");
 
-    if (code != 226) {
+    if (!(code == 226 || code == 250)) {
         debug(9, 1) ("ftpReadTransferDone: Got code %d after sending data\n",
                      code);
         ftpFailed(ftpState, ERR_FTP_PUT_ERROR, 0);
@@ -2997,7 +2997,7 @@ ftpSendReply(FtpStateData * ftpState)
     if (cbdataReferenceValid(ftpState))
         debug(9, 5) ("ftpSendReply: ftpState (%p) is valid!\n", ftpState);
 
-    if (code == 226) {
+    if (code == 226 || code == 250) {
         err_code = (ftpState->mdtm > 0) ? ERR_FTP_PUT_MODIFIED : ERR_FTP_PUT_CREATED;
         http_code = (ftpState->mdtm > 0) ? HTTP_ACCEPTED : HTTP_CREATED;
     } else if (code == 227) {