From: serassio <> Date: Sat, 3 Sep 2005 16:09:09 +0000 (+0000) Subject: Bug #1348: Some odd FTP servers respond with 250 where 226 is expected X-Git-Tag: SQUID_3_0_PRE4~650 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbf07a9459005e44bb35e8db9e1e7e96e24b4e6e;p=thirdparty%2Fsquid.git Bug #1348: Some odd FTP servers respond with 250 where 226 is expected Forward port of 2.5 patch. --- diff --git a/src/ftp.cc b/src/ftp.cc index 0efcd00e31..992d9eabfe 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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) {