From: Amos Jeffries Date: Fri, 5 Mar 2010 01:38:57 +0000 (+1300) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_2_0_1~392 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d9e71e6dea25fc9c83ef7c11fed9f3943bbcba6;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom Swallow 1xx status messages Ported from 2.7. This makes Squid swallow 1xx replies from 1.1 servers safely without breaking the clients connection. --- diff --git a/src/http.cc b/src/http.cc index 39a0d5cc02..503a164f9a 100644 --- a/src/http.cc +++ b/src/http.cc @@ -711,6 +711,26 @@ HttpStateData::processReplyHeader() readBuf->consume(header_bytes_read); } + /* Skip 1xx messages for now. Advertised in Via as an internal 1.0 hop */ + if (newrep->sline.protocol == PROTO_HTTP && newrep->sline.status >= 100 && newrep->sline.status < 200) { + +#if WHEN_HTTP11 + /* When HTTP/1.1 check if the client is expecting a 1xx reply and maybe pass it on */ + if (orig_request->header.has(HDR_EXPECT)) { + // TODO: pass to the client anyway? + } +#endif + delete newrep; + debugs(11, 2, HERE << "1xx headers consume " << header_bytes_read << " bytes header."); + header_bytes_read = 0; + if (reply_bytes_read > 0) + debugs(11, 2, HERE << "1xx headers consume " << reply_bytes_read << " bytes reply."); + reply_bytes_read = 0; + ctx_exit(ctx); + processReplyHeader(); + return; + } + flags.chunked = 0; if (newrep->sline.protocol == PROTO_HTTP && newrep->header.hasListMember(HDR_TRANSFER_ENCODING, "chunked", ',')) { flags.chunked = 1;