Skip to content

Commit

Permalink
Do not mark successful FTP PUT entries with ENTRY_BAD_LENGTH (#1904)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eduard-bagdasaryan authored and squid-anubis committed Oct 1, 2024
1 parent ea10f7d commit 620efbd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/clients/FtpGateway.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,7 @@ ftpWriteTransferDone(Ftp::Gateway * ftpState)
}

ftpState->entry->timestampsSet(); /* XXX Is this needed? */
ftpState->markParsedVirginReplyAsWhole("ftpWriteTransferDone code 226 or 250");
ftpSendReply(ftpState);
}

Expand Down

0 comments on commit 620efbd

Please sign in to comment.