Comment 18 for bug 1423498

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Triage note:

https://github.com/squid-cache/squid/commit/ccc927f9204159637bc77820fbb3f36521a54c86

commit ccc927f9204159637bc77820fbb3f36521a54c86
Author: Alex Rousskov <email address hidden>
Date: Sun Dec 29 07:56:02 2013 -0800

    Bug 3498: FTP PUT assertion Server.cc:246: "r->body_pipe != NULL"

diff --git a/src/ftp.cc b/src/ftp.cc
index f4b108080..71f3d3035 100644
--- a/src/ftp.cc
+++ b/src/ftp.cc
@@ -3051,6 +3051,13 @@ void FtpStateData::readStor()
     debugs(9, 3, HERE);

     if (code == 125 || (code == 150 && Comm::IsConnOpen(data.conn))) {
+ if (!originalRequest()->body_pipe) {
+ debugs(9, 3, "zero-size STOR?");
+ state = WRITING_DATA; // make ftpWriteTransferDone() responsible
+ dataComplete(); // XXX: keep in sync with doneSendingRequestBody()
+ return;
+ }
+
         if (!startRequestBodyFlow()) { // register to receive body data
             ftpFail(this);
             return;