From: Dmitry Kurochkin Date: Wed, 26 Jun 2013 00:35:39 +0000 (+0400) Subject: FTP gateway: fix upload freezing for large files. X-Git-Tag: SQUID_3_5_0_1~117^2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a37179c1739947762b816492ed174e27c81935a;p=thirdparty%2Fsquid.git FTP gateway: fix upload freezing for large files. --- diff --git a/src/client_side.cc b/src/client_side.cc index e456c1e018..2a52f1495d 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -3176,13 +3176,11 @@ ConnStateData::clientReadFtpData(const CommIoCbParams &io) if (io.size > 0) { kb_incr(&(statCounter.client_http.kbytes_in), io.size); - const bool uploadBufWasEmpty = ftp.uploadAvailSize <= 0; char *const current_buf = ftp.uploadBuf + ftp.uploadAvailSize; if (io.buf != current_buf) memmove(current_buf, io.buf, io.size); ftp.uploadAvailSize += io.size; - if (uploadBufWasEmpty) - handleFtpRequestData(); + handleFtpRequestData(); } else if (io.size == 0) { debugs(33, 5, HERE << io.conn << " closed"); FtpCloseDataConnection(this); @@ -3372,6 +3370,11 @@ ConnStateData::abortChunkedRequestBody(const err_type error) void ConnStateData::noteMoreBodySpaceAvailable(BodyPipe::Pointer ) { + if (isFtp) { + handleFtpRequestData(); + return; + } + if (!handleRequestBodyData()) return;