]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not mark successful FTP PUT entries with ENTRY_BAD_LENGTH (#1904)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Mon, 23 Sep 2024 09:31:36 +0000 (09:31 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 1 Oct 2024 13:25:47 +0000 (13:25 +0000)
Since 2021 commit ba3fe8d, we explicitly mark complete responses and
treat all other responses as truncated. That commit missed a case where
the FTP server responds with 226 or 250 code after receiving the upload.
The bug affects HTTP PUT requests using ftp URI scheme.

Incorrect truncation marking adds an unwanted WITH_CLIENT %err_detail to
ERR_FTP_PUT_CREATED transaction records in access.log:

    201 PUT ftp://... ERR_FTP_PUT_CREATED/FTP_REPLY_CODE=226+WITH_CLIENT

Fixed code logs:

    201 PUT ftp://... ERR_FTP_PUT_CREATED/FTP_REPLY_CODE=226

src/clients/FtpGateway.cc

index 1ff69c9d215999a4d2ed79b10a639640fe39d048..675c08dfec292cc0d07a76f8a885bcccd12995c5 100644 (file)
@@ -2272,6 +2272,7 @@ ftpWriteTransferDone(Ftp::Gateway * ftpState)
     }
 
     ftpState->entry->timestampsSet();   /* XXX Is this needed? */
+    ftpState->markParsedVirginReplyAsWhole("ftpWriteTransferDone code 226 or 250");
     ftpSendReply(ftpState);
 }