]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added Expect:100-continue to FTP STOR wrappers for adaptation to avoid stalling
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 29 Aug 2013 14:21:09 +0000 (08:21 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 29 Aug 2013 14:21:09 +0000 (08:21 -0600)
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.

src/client_side.cc

index d49dccfe166ab737549bd0ae06d81bd07035171d..0bbde9ee150eca44c0fc5013a475525aac71f688 100644 (file)
@@ -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;