Description: Fix ftp assertion error when uploading empty file
 Fix a crash when using ftp to upload an empty file through the proxy.
Origin: https://github.com/squid-cache/squid/commit/ccc927f9204159637bc77820fbb3f36521a54c86.patch
Author: Alex Rousskov <rousskov@measurement-factory.com>
Bug: http://bugs.squid-cache.org/show_bug.cgi?id=3498
Bug-Ubuntu: https://launchpad.net/bugs/1423498
Last-Update: 2017-09-28

--- squid3-3.3.8.orig/src/ftp.cc
+++ squid3-3.3.8/src/ftp.cc
@@ -3088,6 +3088,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;
