From: Alex Rousskov Date: Thu, 29 Aug 2013 14:21:09 +0000 (-0600) Subject: Added Expect:100-continue to FTP STOR wrappers for adaptation to avoid stalling X-Git-Tag: SQUID_3_5_0_1~117^2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab768952b257c72e31782b83a99c4d482190d720;p=thirdparty%2Fsquid.git Added Expect:100-continue to FTP STOR wrappers for adaptation to avoid stalling FTP clients that expect an FTP 150 (OK to send data) response from the FTP server before actually uploading content. If an adaptation service starts waiting for the PUT request body before starting to produce an adaptation response (allowing the transaction to reach the FTP server), the FTP transaction will get stuck. It is not clear why this has not been a [known] issue with real HTTP requests containing Expect:100-continue. --- diff --git a/src/client_side.cc b/src/client_side.cc index d49dccfe16..0bbde9ee15 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -5107,8 +5107,10 @@ FtpParseRequest(ConnStateData *connState, HttpRequestMethod *method_p, Http::Pro request->header.putStr(HDR_FTP_COMMAND, cmd.termedBuf()); request->header.putStr(HDR_FTP_ARGUMENTS, params.termedBuf() != NULL ? params.termedBuf() : ""); - if (*method_p == Http::METHOD_PUT) + if (*method_p == Http::METHOD_PUT) { + request->header.putStr(HDR_EXPECT, "100-continue"); request->header.putStr(HDR_TRANSFER_ENCODING, "chunked"); + } ClientHttpRequest *const http = new ClientHttpRequest(connState); http->request = request;