--------------------- PatchSet 9935 Date: 2007/09/03 00:50:50 Author: hno Branch: http11 Tag: (none) Log: ignore_expect_100 squid.conf option Members: src/cf.data.pre:1.161.6.9->1.161.6.10 src/client_side.c:1.154.2.24->1.154.2.25 src/structs.h:1.136.6.10->1.136.6.11 Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.161.6.9 retrieving revision 1.161.6.10 diff -u -r1.161.6.9 -r1.161.6.10 --- squid/src/cf.data.pre 31 Aug 2007 22:14:20 -0000 1.161.6.9 +++ squid/src/cf.data.pre 3 Sep 2007 00:50:50 -0000 1.161.6.10 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.161.6.9 2007/08/31 22:14:20 hno Exp $ +# $Id: cf.data.pre,v 1.161.6.10 2007/09/03 00:50:50 hno Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -2590,6 +2590,18 @@ Note: The HTTP/1.1 support is still incomplete. DOC_END +NAME: ignore_expect_100 +COMMENT: on|off +TYPE: onoff +LOC: Config.onoff.ignore_expect_100 +DEFAULT: off +DOC_START + This option makes Squid ignore any Expect: 100-continue header present + in the request. + Note: Enabling this is a HTTP protocol violation, but some client may + not handle it well.. +DOC_END + COMMENT_START TIMEOUTS ----------------------------------------------------------------------------- Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.154.2.24 retrieving revision 1.154.2.25 diff -u -r1.154.2.24 -r1.154.2.25 --- squid/src/client_side.c 3 Sep 2007 00:11:06 -0000 1.154.2.24 +++ squid/src/client_side.c 3 Sep 2007 00:50:50 -0000 1.154.2.25 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.154.2.24 2007/09/03 00:11:06 hno Exp $ + * $Id: client_side.c,v 1.154.2.25 2007/09/03 00:50:50 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -3243,11 +3243,20 @@ url); r->flags.collapsed = 0; if (httpHeaderHas(&r->header, HDR_EXPECT)) { - ErrorState *err = errorCon(ERR_INVALID_REQ, HTTP_EXPECTATION_FAILED, r); - http->log_type = LOG_TCP_MISS; - http->entry = clientCreateStoreEntry(http, http->request->method, null_request_flags); - errorAppendEntry(http->entry, err); - return; + int supported = 0; + if (Config.onoff.ignore_expect_100) { + String expect = httpHeaderGetList(&r->header, HDR_EXPECT); + if (strCaseCmp(expect, "100-continue")) + supported = 1; + stringClean(&expect); + } + if (!supported) { + ErrorState *err = errorCon(ERR_INVALID_REQ, HTTP_EXPECTATION_FAILED, r); + http->log_type = LOG_TCP_MISS; + http->entry = clientCreateStoreEntry(http, http->request->method, null_request_flags); + errorAppendEntry(http->entry, err); + return; + } } if (r->method == METHOD_CONNECT && !http->redirect.status) { http->log_type = LOG_TCP_MISS; Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.136.6.10 retrieving revision 1.136.6.11 diff -u -r1.136.6.10 -r1.136.6.11 --- squid/src/structs.h 12 Aug 2007 01:14:03 -0000 1.136.6.10 +++ squid/src/structs.h 3 Sep 2007 00:50:52 -0000 1.136.6.11 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.136.6.10 2007/08/12 01:14:03 hno Exp $ + * $Id: structs.h,v 1.136.6.11 2007/09/03 00:50:52 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -679,6 +679,7 @@ int delay_pool_uses_indirect_client; int log_uses_indirect_client; #endif + int ignore_expect_100; } onoff; acl *aclList; struct {