r86362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86361‎ | r86362 | r86363 >
Date:23:01, 18 April 2011
Author:laner
Status:deferred
Tags:
Comment:
* Updating to squid 2.7.9
* Adding four new patches
** Adding a patch for a memory leak not yet fixed in 2.7.9, but fixed upstream
** Adding a patch for max forwards, so that we can configure the maximum number of forwards
** Adding a patch to fix bug 28517
** Adding a patch for multicast udp logging
* Modified some older patches to be compliant with newer version of squid
Modified paths:
  • /trunk/debs/squid/debian/changelog (modified) (history)
  • /trunk/debs/squid/debian/patches/00list (modified) (history)
  • /trunk/debs/squid/debian/patches/23-variant-invalidation.dpatch (modified) (history)
  • /trunk/debs/squid/debian/patches/26-vary_options.dpatch (modified) (history)
  • /trunk/debs/squid/debian/patches/27-malformed-requests-memoryleak.dpatch (added) (history)
  • /trunk/debs/squid/debian/patches/28-retry-options.dpatch (added) (history)
  • /trunk/debs/squid/debian/patches/29-rfc1738_unescape.dpatch (added) (history)
  • /trunk/debs/squid/debian/patches/30-multicast-udp.dpatch (added) (history)

Diff [purge]

Index: trunk/debs/squid/debian/patches/26-vary_options.dpatch
@@ -6,10 +6,10 @@
77 ## DP: Adds support for the X-Vary-Options response header
88
99 @DPATCH@
10 -diff -urNad squid-2.7.5~/configure.in squid-2.7.5/configure.in
11 -+++ squid-2.7.5/configure.in 2009-01-27 16:34:13.000000000 +0000
12 -@@ -1533,6 +1533,16 @@
 10+diff -urNad squid-2.7.9~/configure.in squid-2.7.9/configure.in
 11+--- squid-2.7.9~/configure.in 2010-03-17 00:10:12.000000000 +0000
 12+@@ -1533,6 +1533,26 @@
1313 fi
1414 ])
1515
@@ -23,12 +23,22 @@
2424 + fi
2525 +])
2626 +
 27++dnl Enable vary options
 28++AC_ARG_ENABLE(vary_options,
 29++[ --enable-vary-options
 30++ Enable support for the X-Vary-Options header.],
 31++[ if test "$enableval" = "yes" ; then
 32++ echo "Enabling support for vary options"
 33++ AC_DEFINE(VARY_OPTIONS, 1, [Enable support for the X-Vary-Options header])
 34++ fi
 35++])
 36++
2737 AC_ARG_ENABLE(follow-x-forwarded-for,
2838 [ --enable-follow-x-forwarded-for
2939 Enable support for following the X-Forwarded-For
30 -diff -urNad squid-2.7.5~/src/HttpHeader.c squid-2.7.5/src/HttpHeader.c
31 -+++ squid-2.7.5/src/HttpHeader.c 2009-01-27 16:34:13.000000000 +0000
 40+diff -urNad squid-2.7.9~/src/HttpHeader.c squid-2.7.9/src/HttpHeader.c
 41+--- squid-2.7.9~/src/HttpHeader.c 2008-09-25 02:33:37.000000000 +0000
3242 @@ -134,6 +134,9 @@
3343 #if X_ACCELERATOR_VARY
3444 {"X-Accelerator-Vary", HDR_X_ACCELERATOR_VARY, ftStr},
@@ -62,41 +72,41 @@
6373 +#if VARY_OPTIONS
6474 + HttpHeaderEntry *e;
6575 + if ((e = httpHeaderFindEntry(hdr, HDR_X_VARY_OPTIONS))) {
66 -+ stringInit(&hdrString, strBuf(e->value));
67 -+ return hdrString;
 76++ stringInit(&hdrString, strBuf(e->value));
 77++ return hdrString;
6878 + }
6979 +#endif
70 -+
 80++
7181 + hdrString = httpHeaderGetList(hdr, HDR_VARY);
7282 +#if X_ACCELERATOR_VARY
7383 + {
74 -+ String xavString = StringNull;
75 -+ xavString = httpHeaderGetList(hdr, HDR_X_ACCELERATOR_VARY);
76 -+ if (strBuf(xavString))
77 -+ strListAdd(&hdrString, strBuf(xavString), ',');
78 -+ stringClean(&xavString);
 84++ String xavString = StringNull;
 85++ xavString = httpHeaderGetList(hdr, HDR_X_ACCELERATOR_VARY);
 86++ if (strBuf(xavString))
 87++ strListAdd(&hdrString, strBuf(xavString), ',');
 88++ stringClean(&xavString);
7989 + }
8090 +#endif
8191 + return hdrString;
8292 +}
8393 +
8494 +/*
85 -+ * Returns TRUE if at least one of the vary headers are present
 95++ * Returns TRUE if at least one of the vary headers are present
8696 + */
8797 +int httpHeaderHasVary(const HttpHeader * hdr)
8898 +{
8999 +#if VARY_OPTIONS
90100 + if (httpHeaderHas(hdr, HDR_X_VARY_OPTIONS)) {
91 -+ return TRUE;
 101++ return TRUE;
92102 + }
93103 +#endif
94104 +#if X_ACCELERATOR_VARY
95105 + if (httpHeaderHas(hdr, HDR_X_ACCELERATOR_VARY)) {
96 -+ return TRUE;
 106++ return TRUE;
97107 + }
98108 +#endif
99109 + if (httpHeaderHas(hdr, HDR_VARY)) {
100 -+ return TRUE;
 110++ return TRUE;
101111 + }
102112 + return FALSE;
103113 +}
@@ -110,9 +120,9 @@
111121 }
112122 +
113123 +
114 -diff -urNad squid-2.7.5~/src/HttpReply.c squid-2.7.5/src/HttpReply.c
115 -+++ squid-2.7.5/src/HttpReply.c 2009-01-27 16:34:13.000000000 +0000
 124+diff -urNad squid-2.7.9~/src/HttpReply.c squid-2.7.9/src/HttpReply.c
 125+--- squid-2.7.9~/src/HttpReply.c 2008-01-23 15:31:51.000000000 +0000
116126 @@ -315,8 +315,7 @@
117127 return squid_curtime;
118128 }
@@ -123,9 +133,9 @@
124134 const time_t d = httpHeaderGetTime(&rep->header, HDR_DATE);
125135 const time_t e = httpHeaderGetTime(&rep->header, HDR_EXPIRES);
126136 if (d == e)
127 -diff -urNad squid-2.7.5~/src/client_side.c squid-2.7.5/src/client_side.c
128 -+++ squid-2.7.5/src/client_side.c 2009-01-27 16:34:13.000000000 +0000
 137+diff -urNad squid-2.7.9~/src/client_side.c squid-2.7.9/src/client_side.c
 138+--- squid-2.7.9~/src/client_side.c 2011-04-11 20:00:29.000000000 +0000
129139 @@ -643,10 +643,7 @@
130140 request_t *request = http->request;
131141 const char *etag = httpHeaderGetStr(&rep->header, HDR_ETAG);
@@ -138,7 +148,7 @@
139149 if (has_vary)
140150 vary = httpMakeVaryMark(request, rep);
141151
142 -@@ -5075,10 +5072,7 @@
 152+@@ -5067,10 +5064,7 @@
143153 varyEvaluateMatch(StoreEntry * entry, request_t * request)
144154 {
145155 const char *vary = request->vary_headers;
@@ -150,9 +160,9 @@
151161 if (!has_vary || !entry->mem_obj->vary_headers) {
152162 if (vary) {
153163 /* Oops... something odd is going on here.. */
154 -diff -urNad squid-2.7.5~/src/defines.h squid-2.7.5/src/defines.h
155 -+++ squid-2.7.5/src/defines.h 2009-01-27 16:34:13.000000000 +0000
 164+diff -urNad squid-2.7.9~/src/defines.h squid-2.7.9/src/defines.h
 165+--- squid-2.7.9~/src/defines.h 2011-04-11 20:00:29.000000000 +0000
156166 @@ -366,4 +366,10 @@
157167
158168 #define LOGFILE_SEQNO(n) ( (n)->sequence_number )
@@ -164,9 +174,9 @@
165175 +#endif
166176 +
167177 #endif /* SQUID_DEFINES_H */
168 -diff -urNad squid-2.7.5~/src/enums.h squid-2.7.5/src/enums.h
169 -+++ squid-2.7.5/src/enums.h 2009-01-27 16:34:13.000000000 +0000
 178+diff -urNad squid-2.7.9~/src/enums.h squid-2.7.9/src/enums.h
 179+--- squid-2.7.9~/src/enums.h 2011-04-11 20:00:29.000000000 +0000
170180 @@ -259,6 +259,9 @@
171181 #if X_ACCELERATOR_VARY
172182 HDR_X_ACCELERATOR_VARY,
@@ -177,9 +187,9 @@
178188 HDR_X_ERROR_URL, /* errormap, requested URL */
179189 HDR_X_ERROR_STATUS, /* errormap, received HTTP status line */
180190 HDR_X_HTTP09_FIRST_LINE, /* internal, first line of HTTP/0.9 response */
181 -diff -urNad squid-2.7.5~/src/http.c squid-2.7.5/src/http.c
182 -+++ squid-2.7.5/src/http.c 2009-01-27 16:34:13.000000000 +0000
 191+diff -urNad squid-2.7.9~/src/http.c squid-2.7.9/src/http.c
 192+--- squid-2.7.9~/src/http.c 2011-04-11 20:00:29.000000000 +0000
183193 @@ -355,20 +355,29 @@
184194 String vstr = StringNull;
185195
@@ -321,10 +331,10 @@
322332 const char *vary = NULL;
323333 if (Config.onoff.cache_vary)
324334 vary = httpMakeVaryMark(httpState->orig_request, reply);
325 -diff -urNad squid-2.7.5~/src/protos.h squid-2.7.5/src/protos.h
326 -+++ squid-2.7.5/src/protos.h 2009-01-27 16:34:13.000000000 +0000
327 -@@ -464,6 +464,8 @@
 335+diff -urNad squid-2.7.9~/src/protos.h squid-2.7.9/src/protos.h
 336+--- squid-2.7.9~/src/protos.h 2011-04-11 20:00:29.000000000 +0000
 337+@@ -465,6 +465,8 @@
328338 extern squid_off_t httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id);
329339 extern time_t httpHeaderGetTime(const HttpHeader * hdr, http_hdr_type id);
330340 extern TimeOrTag httpHeaderGetTimeOrTag(const HttpHeader * hdr, http_hdr_type id);
@@ -333,12 +343,12 @@
334344 extern HttpHdrCc *httpHeaderGetCc(const HttpHeader * hdr);
335345 extern HttpHdrRange *httpHeaderGetRange(const HttpHeader * hdr);
336346 extern HttpHdrContRange *httpHeaderGetContRange(const HttpHeader * hdr);
337 -diff -urNad squid-2.7.5~/src/store.c squid-2.7.5/src/store.c
338 -+++ squid-2.7.5/src/store.c 2009-01-27 16:34:13.000000000 +0000
339 -@@ -742,7 +742,12 @@
340 - flags.cachable = 1;
341 - state->e = storeCreateEntry(url, flags, method);
 347+diff -urNad squid-2.7.9~/src/store.c squid-2.7.9/src/store.c
 348+--- squid-2.7.9~/src/store.c 2011-04-11 20:00:29.000000000 +0000
 349+@@ -747,7 +747,12 @@
 350+ if (store_url)
 351+ state->e->mem_obj->store_url = xstrdup(store_url);
342352 httpReplySetHeaders(state->e->mem_obj->reply, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
343353 +#if VARY_OPTIONS
344354 + /* Can't put a string into a list header */
@@ -349,7 +359,7 @@
350360 storeSetPublicKey(state->e);
351361 if (!state->oe) {
352362 /* New entry, create new unique ID */
353 -@@ -1061,20 +1066,8 @@
 363+@@ -1071,20 +1076,8 @@
354364 }
355365 newkey = storeKeyPublicByRequest(mem->request);
356366 if (mem->vary_headers && !EBIT_TEST(e->flags, KEY_EARLY_PUBLIC)) {
@@ -368,6 +378,6 @@
369379 - stringClean(&varyhdr);
370380 -#endif
371381 + String vary = httpHeaderGetVary(&mem->reply->header);
372 - /* Create or update the vary object */
373 - vary_id = storeAddVary(mem->url, mem->log_url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
374 - if (vary_id.create_time) {
 382+ /* Create or update the vary object */
 383+ vary_id = storeAddVary(mem->url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
 384+ if (vary_id.create_time) {
Index: trunk/debs/squid/debian/patches/28-retry-options.dpatch
@@ -0,0 +1,49 @@
 2+#! /bin/sh /usr/share/dpatch/dpatch-run
 3+## 28-retry-options.dpatch by <root@ragweed.knams.wikimedia.org>
 4+##
 5+## All lines beginning with `## DP:' are a description of the patch.
 6+## DP: No description.
 7+
 8+@DPATCH@
 9+diff -urNad squid-2.7.9~/src/cf.data.pre squid-2.7.9/src/cf.data.pre
 10+--- squid-2.7.9~/src/cf.data.pre 2009-11-09 22:38:57.000000000 +0000
 11+@@ -5516,6 +5516,15 @@
 12+ takes place if Squid fails to get a satisfying response.
 13+ DOC_END
 14+
 15++NAME: maximum_forwards
 16++TYPE: int
 17++LOC: Config.retry.maxforwards
 18++DEFAULT: 10
 19++DOC_START
 20++ This sets the maximum number of re-forwarding requests Squid
 21++ will attempt if it does not get a satisying response.
 22++DOC_END
 23++
 24+ NAME: retry_on_error
 25+ TYPE: onoff
 26+ LOC: Config.retry.onerror
 27+diff -urNad squid-2.7.9~/src/forward.c squid-2.7.9/src/forward.c
 28+--- squid-2.7.9~/src/forward.c 2008-07-18 00:47:48.000000000 +0000
 29+@@ -137,7 +137,7 @@
 30+ return 0;
 31+ if (fwdState->entry->mem_obj->inmem_hi > 0)
 32+ return 0;
 33+- if (fwdState->n_tries > 10)
 34++ if (fwdState->n_tries > Config.retry.maxforwards)
 35+ return 0;
 36+ if (fwdState->origin_tries > 2)
 37+ return 0;
 38+diff -urNad squid-2.7.9~/src/structs.h squid-2.7.9/src/structs.h
 39+--- squid-2.7.9~/src/structs.h 2011-04-13 18:43:58.000000000 +0000
 40+@@ -767,6 +767,7 @@
 41+ struct {
 42+ int maxtries;
 43+ int onerror;
 44++ int maxforwards;
 45+ } retry;
 46+ struct {
 47+ squid_off_t limit;
Property changes on: trunk/debs/squid/debian/patches/28-retry-options.dpatch
___________________________________________________________________
Added: svn:executable
148 + *
Index: trunk/debs/squid/debian/patches/23-variant-invalidation.dpatch
@@ -5,27 +5,423 @@
66 ## DP: No description.
77
88 @DPATCH@
9 -diff -urNad squid-2.7.6~/src/client_side.c squid-2.7.6/src/client_side.c
10 -+++ squid-2.7.6/src/client_side.c 2009-02-12 20:13:01.000000000 +0000
11 -@@ -2331,6 +2331,16 @@
 9+diff -urNad squid-2.7.9~/debian/patches/23-variant-invalidation.dpatch~ squid-2.7.9/debian/patches/23-variant-invalidation.dpatch~
 10+--- squid-2.7.9~/debian/patches/23-variant-invalidation.dpatch~ 1970-01-01 00:00:00.000000000 +0000
 11+@@ -0,0 +1,358 @@
 12++#! /bin/sh /usr/share/dpatch/dpatch-run
 13++## 23-variant-invalidation.dpatch by Tim Starling <tstarling@wikimedia.org>
 14++##
 15++## All lines beginning with `## DP:' are a description of the patch.
 16++## DP: No description.
 17++
 18++@DPATCH@
 19++diff -urNad squid-2.7.6~/src/client_side.c squid-2.7.6/src/client_side.c
 20++--- squid-2.7.6~/src/client_side.c 2009-02-12 20:02:24.000000000 +0000
 21++@@ -2331,6 +2331,16 @@
 22++ http->sc = NULL;
 23++ clientProcessMiss(http);
 24++ return;
 25++ }
 26++ if (r->method == METHOD_PURGE) {
 27++ http->entry = NULL;
 28++@@ -5086,6 +5096,8 @@
 29++ */
 30++ vary = httpMakeVaryMark(request, entry->mem_obj->reply);
 31++ if (vary) {
 32++ return VARY_OTHER;
 33++ } else {
 34++ /* Ouch.. we cannot handle this kind of variance */
 35++@@ -5103,6 +5115,13 @@
 36++ /* This request was merged before we knew the outcome. Don't trust the response */
 37++ /* restart vary processing from the beginning */
 38++ return VARY_RESTART;
 39++ } else {
 40++ return VARY_MATCH;
 41++ }
 42++diff -urNad squid-2.7.6~/src/comm_generic.c squid-2.7.6/src/comm_generic.c
 43++--- squid-2.7.6~/src/comm_generic.c 2009-02-12 20:02:24.000000000 +0000
 44++@@ -360,7 +360,7 @@
 45++ int rc;
 46++ double start = current_dtime;
 47++
 48++- debug(5, 3) ("comm_select: timeout %d\n", msec);
 49++
 50++ if (msec > MAX_POLL_TIME)
 51++ msec = MAX_POLL_TIME;
 52++diff -urNad squid-2.7.6~/src/enums.h squid-2.7.6/src/enums.h
 53++--- squid-2.7.6~/src/enums.h 2009-02-12 20:02:24.000000000 +0000
 54++@@ -661,6 +661,7 @@
 55++ STORE_META_VARY_HEADERS, /* Stores Vary request headers */
 56++ STORE_META_STD_LFS, /* standard metadata in lfs format */
 57++ STORE_META_OBJSIZE, /* object size, if its known */
 58++ STORE_META_STOREURL, /* the store url, if different to the normal URL */
 59++ STORE_META_END
 60++ };
 61++@@ -755,7 +756,8 @@
 62++ VARY_MATCH,
 63++ VARY_OTHER,
 64++ VARY_RESTART,
 65++- VARY_CANCEL
 66++ };
 67++
 68++ /* Windows Port */
 69++diff -urNad squid-2.7.6~/src/http.c squid-2.7.6/src/http.c
 70++--- squid-2.7.6~/src/http.c 2009-02-12 20:13:01.000000000 +0000
 71++@@ -229,7 +229,7 @@
 72++ const char *v;
 73++ #if HTTP_VIOLATIONS
 74++ const refresh_t *R = NULL;
 75++- /* This strange looking define first looks up the frefresh pattern
 76++ * and then checks if the specified flag is set. The main purpose
 77++ * of this is to simplify the refresh pattern lookup
 78++ */
 79++diff -urNad squid-2.7.6~/src/protos.h squid-2.7.6/src/protos.h
 80++--- squid-2.7.6~/src/protos.h 2009-02-12 20:02:24.000000000 +0000
 81++@@ -1468,7 +1468,7 @@
 82++ /* ETag support */
 83++ void storeLocateVaryDone(VaryData * data);
 84++ void storeLocateVary(StoreEntry * e, int offset, const char *vary_data, String accept_encoding, STLVCB * callback, void *cbdata);
 85++-void storeAddVary(const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding);
 86++
 87++ /* New HTTP message parsing support */
 88++ extern void HttpMsgBufInit(HttpMsgBuf * hmsg, const char *buf, size_t size);
 89++diff -urNad squid-2.7.6~/src/store.c squid-2.7.6/src/store.c
 90++--- squid-2.7.6~/src/store.c 2009-02-12 20:02:24.000000000 +0000
 91++@@ -87,6 +87,7 @@
 92++ static void storeEntryDereferenced(StoreEntry *);
 93++ static int getKeyCounter(void);
 94++ static int storeKeepInMemory(const StoreEntry *);
 95++ static OBJH storeCheckCachableStats;
 96++ static EVH storeLateRelease;
 97++
 98++@@ -347,8 +348,9 @@
 99++ StoreEntry *
 100++ storeGet(const cache_key * key)
 101++ {
 102++- debug(20, 3) ("storeGet: looking up %s\n", storeKeyText(key));
 103++- return (StoreEntry *) hash_lookup(store_table, key);
 104++ }
 105++
 106++ StoreEntry *
 107++@@ -452,6 +454,11 @@
 108++ storeAppendPrintf(state->e, "ETag: %s\n", state->etag);
 109++ storeAppendPrintf(state->e, "VaryData: %s\n", state->vary_headers);
 110++ }
 111++ storeTimestampsSet(state->e);
 112++ storeComplete(state->e);
 113++ storeTimestampsSet(state->e);
 114++@@ -563,6 +570,7 @@
 115++ debug(11, 3) ("storeAddVaryReadOld: %p seen_offset=%" PRINTF_OFF_T " buf_offset=%d size=%d\n", data, state->seen_offset, (int) state->buf_offset, (int) size);
 116++ if (size <= 0) {
 117++ debug(11, 2) ("storeAddVaryReadOld: DONE\n");
 118++ cbdataFree(state);
 119++ return;
 120++ }
 121++@@ -706,12 +714,13 @@
 122++
 123++ /*
 124++ * Adds/updates a Vary record.
 125++- * For updates only one of key or etag needs to be specified
 126++- * At leas one of key or etag must be specified, preferably both.
 127++ */
 128++-void
 129++ storeAddVary(const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding)
 130++ {
 131++ AddVaryState *state;
 132++ request_flags flags = null_request_flags;
 133++ CBDATA_INIT_TYPE_FREECB(AddVaryState, free_AddVaryState);
 134++@@ -734,6 +743,11 @@
 135++ httpReplySetHeaders(state->e->mem_obj->reply, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
 136++ httpHeaderPutStr(&state->e->mem_obj->reply->header, HDR_VARY, vary);
 137++ storeSetPublicKey(state->e);
 138++ storeBuffer(state->e);
 139++ httpReplySwapOut(state->e->mem_obj->reply, state->e);
 140++ if (state->oe) {
 141++@@ -752,7 +766,15 @@
 142++ * modifications above)
 143++ */
 144++ /* Swap in the dummy Vary object */
 145++- if (!state->oe->mem_obj) {
 146++ storeCreateMemObject(state->oe, state->url);
 147++ state->oe->mem_obj->method = method;
 148++ }
 149++@@ -764,10 +786,10 @@
 150++ state->buf,
 151++ storeAddVaryReadOld,
 152++ state);
 153++- return;
 154++ } else {
 155++ cbdataFree(state);
 156++ }
 157++ }
 158++
 159++ static MemPool *VaryData_pool = NULL;
 160++@@ -810,9 +832,10 @@
 161++ static void
 162++ storeLocateVaryCallback(LocateVaryState * state)
 163++ {
 164++ if (cbdataValid(state->callback_data)) {
 165++ VaryData *data = state->data;
 166++- if (data->key || data->etags.count) {
 167++ state->callback(data, state->callback_data);
 168++ state->data = NULL; /* now owned by the caller */
 169++ } else {
 170++@@ -989,6 +1012,7 @@
 171++ StoreEntry *e2 = NULL;
 172++ const cache_key *newkey;
 173++ MemObject *mem = e->mem_obj;
 174++ if (e->hash.key && !EBIT_TEST(e->flags, KEY_PRIVATE)) {
 175++ if (EBIT_TEST(e->flags, KEY_EARLY_PUBLIC)) {
 176++ EBIT_CLR(e->flags, KEY_EARLY_PUBLIC);
 177++@@ -1042,6 +1066,7 @@
 178++ newkey = storeKeyPublicByRequest(mem->request);
 179++ if (mem->vary_headers && !EBIT_TEST(e->flags, KEY_EARLY_PUBLIC)) {
 180++ String vary = StringNull;
 181++ String varyhdr;
 182++ varyhdr = httpHeaderGetList(&mem->reply->header, HDR_VARY);
 183++ if (strBuf(varyhdr))
 184++@@ -1054,8 +1079,28 @@
 185++ strListAdd(&vary, strBuf(varyhdr), ',');
 186++ stringClean(&varyhdr);
 187++ #endif
 188++- storeAddVary(mem->url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
 189++- stringClean(&vary);
 190++ }
 191++ } else {
 192++ newkey = storeKeyPublic(storeLookupUrl(e), mem->method);
 193++@@ -1829,6 +1874,8 @@
 194++ debug(20, 1) ("MemObject->url: %p %s\n",
 195++ mem->url,
 196++ checkNullString(mem->url));
 197++ }
 198++
 199++ void
 200++@@ -2112,3 +2159,15 @@
 201++ if (e->mem_obj)
 202++ e->mem_obj->serverfd = -1;
 203++ }
 204++diff -urNad squid-2.7.6~/src/store_client.c squid-2.7.6/src/store_client.c
 205++--- squid-2.7.6~/src/store_client.c 2009-02-12 20:02:24.000000000 +0000
 206++@@ -441,6 +441,9 @@
 207++ mem->vary_headers = xstrdup(t->value);
 208++ }
 209++ break;
 210++ default:
 211++ debug(20, 2) ("WARNING: got unused STORE_META type %d\n", t->type);
 212++ break;
 213++diff -urNad squid-2.7.6~/src/store_swapmeta.c squid-2.7.6/src/store_swapmeta.c
 214++--- squid-2.7.6~/src/store_swapmeta.c 2009-02-12 20:02:24.000000000 +0000
 215++@@ -86,6 +86,7 @@
 216++ vary = e->mem_obj->vary_headers;
 217++ if (vary)
 218++ T = storeSwapTLVAdd(STORE_META_VARY_HEADERS, vary, strlen(vary) + 1, T);
 219++ if (e->mem_obj->store_url)
 220++ T = storeSwapTLVAdd(STORE_META_STOREURL, e->mem_obj->store_url, strlen(e->mem_obj->store_url) + 1, T);
 221++ return TLV;
 222++diff -urNad squid-2.7.6~/src/structs.h squid-2.7.6/src/structs.h
 223++--- squid-2.7.6~/src/structs.h 2009-02-12 20:02:24.000000000 +0000
 224++@@ -1732,6 +1732,11 @@
 225++ void (*Done) (RemovalPurgeWalker * walker);
 226++ };
 227++
 228++ /* This structure can be freed while object is purged out from memory */
 229++ struct _MemObject {
 230++ method_t method;
 231++@@ -1772,6 +1777,7 @@
 232++ StoreEntry *old_entry;
 233++ time_t refresh_timestamp;
 234++ time_t stale_while_revalidate;
 235++ };
 236++
 237++ struct _StoreEntry {
 238++@@ -1954,6 +1960,7 @@
 239++ char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */
 240++ String vary_encoding; /* Used when varying entities are detected. Changes how the store key is calculated. */
 241++ VaryData *vary;
 242++ Array *etags; /* possible known entity tags (Vary MISS) */
 243++ char *etag; /* current entity tag, cache validation */
 244++ unsigned int done_etag:1; /* We have done clientProcessETag on this, don't attempt it again */
 245++diff -urNad squid-2.7.6~/src/typedefs.h squid-2.7.6/src/typedefs.h
 246++--- squid-2.7.6~/src/typedefs.h 2009-02-12 20:02:24.000000000 +0000
 247++@@ -226,6 +226,7 @@
 248++ typedef struct _RemovalPolicySettings RemovalPolicySettings;
 249++ typedef struct _errormap errormap;
 250++ typedef struct _PeerMonitor PeerMonitor;
 251++
 252++ typedef struct _http_version_t http_version_t;
 253++
 254+diff -urNad squid-2.7.9~/errors/Makefile.am squid-2.7.9/errors/Makefile.am
 255+--- squid-2.7.9~/errors/Makefile.am 2011-04-11 20:17:44.000000000 +0000
 256+@@ -45,8 +45,7 @@
 257+ Turkish \
 258+ Ukrainian-1251 \
 259+ Ukrainian-koi8-u \
 260+- Ukrainian-utf8 \
 261+- Wikimedia
 262++ Ukrainian-utf8
 263+
 264+ install-data-local:
 265+ @for l in $(INSTALL_LANGUAGES); do \
 266+diff -urNad squid-2.7.9~/helpers/basic_auth/SMB/smb_auth.sh squid-2.7.9/helpers/basic_auth/SMB/smb_auth.sh
 267+--- squid-2.7.9~/helpers/basic_auth/SMB/smb_auth.sh 2011-04-11 20:17:44.000000000 +0000
 268+@@ -24,7 +24,7 @@
 269+ read AUTHSHARE
 270+ read AUTHFILE
 271+ read SMBUSER
 272+-read -r SMBPASS
 273++read SMBPASS
 274+
 275+ # Find domain controller
 276+ echo "Domain name: $DOMAINNAME"
 277+@@ -47,7 +47,7 @@
 278+ addropt=""
 279+ fi
 280+ echo "Query address options: $addropt"
 281+-dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+\..+ / { print $1 ; exit }'`
 282++dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'`
 283+ echo "Domain controller IP address: $dcip"
 284+ [ -n "$dcip" ] || exit 1
 285+
 286+diff -urNad squid-2.7.9~/src/client_side.c squid-2.7.9/src/client_side.c
 287+--- squid-2.7.9~/src/client_side.c 2010-02-14 00:46:25.000000000 +0000
 288+@@ -2325,6 +2325,16 @@
12289 http->sc = NULL;
13290 clientProcessMiss(http);
14291 return;
15292 + case VARY_EXPIRED:
16 -+ /* Variant is expired. Delete it and process as a miss. */
17 -+ debug(33, 2) ("clientProcessHit: Variant expired, deleting\n");
18 -+ storeClientUnregister(http->sc, e, http);
19 -+ http->sc = NULL;
20 -+ storeRelease(e);
21 -+ storeUnlockObject(e);
22 -+ http->entry = NULL;
23 -+ clientProcessMiss(http);
24 -+ return;
 293++ /* Variant is expired. Delete it and process as a miss. */
 294++ debug(33, 2) ("clientProcessHit: Variant expired, deleting\n");
 295++ storeClientUnregister(http->sc, e, http);
 296++ http->sc = NULL;
 297++ storeRelease(e);
 298++ storeUnlockObject(e);
 299++ http->entry = NULL;
 300++ clientProcessMiss(http);
 301++ return;
25302 }
26303 if (r->method == METHOD_PURGE) {
27304 http->entry = NULL;
28 -@@ -5086,6 +5096,8 @@
 305+@@ -5078,6 +5088,8 @@
29306 */
30307 vary = httpMakeVaryMark(request, entry->mem_obj->reply);
31308 if (vary) {
@@ -34,23 +430,23 @@
35431 return VARY_OTHER;
36432 } else {
37433 /* Ouch.. we cannot handle this kind of variance */
38 -@@ -5103,6 +5115,13 @@
 434+@@ -5095,6 +5107,13 @@
39435 /* This request was merged before we knew the outcome. Don't trust the response */
40436 /* restart vary processing from the beginning */
41437 return VARY_RESTART;
42438 + } else if (request->vary_id.create_time != entry->mem_obj->vary_id.create_time ||
43 -+ request->vary_id.serial != entry->mem_obj->vary_id.serial) {
 439++ request->vary_id.serial != entry->mem_obj->vary_id.serial) {
44440 + /* vary_id mismatch, the variant must be expired */
45441 + debug(33, 3) ("varyEvaluateMatch: vary ID mismatch, parent is %ld.%u, child is %ld.%u\n",
46 -+ request->vary_id.create_time, request->vary_id.serial,
47 -+ entry->mem_obj->vary_id.create_time, entry->mem_obj->vary_id.serial);
 442++ request->vary_id.create_time, request->vary_id.serial,
 443++ entry->mem_obj->vary_id.create_time, entry->mem_obj->vary_id.serial);
48444 + return VARY_EXPIRED;
49445 } else {
50446 return VARY_MATCH;
51447 }
52 -diff -urNad squid-2.7.6~/src/comm_generic.c squid-2.7.6/src/comm_generic.c
53 -+++ squid-2.7.6/src/comm_generic.c 2009-02-12 20:13:01.000000000 +0000
 448+diff -urNad squid-2.7.9~/src/comm_generic.c squid-2.7.9/src/comm_generic.c
 449+--- squid-2.7.9~/src/comm_generic.c 2008-05-27 12:49:39.000000000 +0000
54450 @@ -360,7 +360,7 @@
55451 int rc;
56452 double start = current_dtime;
@@ -60,9 +456,21 @@
61457
62458 if (msec > MAX_POLL_TIME)
63459 msec = MAX_POLL_TIME;
64 -diff -urNad squid-2.7.6~/src/enums.h squid-2.7.6/src/enums.h
65 -+++ squid-2.7.6/src/enums.h 2009-02-12 20:13:01.000000000 +0000
 460+diff -urNad squid-2.7.9~/src/defines.h squid-2.7.9/src/defines.h
 461+--- squid-2.7.9~/src/defines.h 2011-04-11 20:17:44.000000000 +0000
 462+@@ -259,7 +259,7 @@
 463+
 464+ /* were to look for errors if config path fails */
 465+ #ifndef DEFAULT_SQUID_ERROR_DIR
 466+-#define DEFAULT_SQUID_ERROR_DIR "/usr/share/squid/errors/Wikimedia"
 467++#define DEFAULT_SQUID_ERROR_DIR "/usr/local/squid/etc/errors"
 468+ #endif
 469+
 470+ /* gb_type operations */
 471+diff -urNad squid-2.7.9~/src/enums.h squid-2.7.9/src/enums.h
 472+--- squid-2.7.9~/src/enums.h 2009-06-25 22:48:37.000000000 +0000
66473 @@ -661,6 +661,7 @@
67474 STORE_META_VARY_HEADERS, /* Stores Vary request headers */
68475 STORE_META_STD_LFS, /* standard metadata in lfs format */
@@ -81,9 +489,9 @@
82490 };
83491
84492 /* Windows Port */
85 -diff -urNad squid-2.7.6~/src/http.c squid-2.7.6/src/http.c
86 -+++ squid-2.7.6/src/http.c 2009-02-12 20:13:01.000000000 +0000
 493+diff -urNad squid-2.7.9~/src/http.c squid-2.7.9/src/http.c
 494+--- squid-2.7.9~/src/http.c 2011-04-11 20:17:44.000000000 +0000
87495 @@ -229,7 +229,7 @@
88496 const char *v;
89497 #if HTTP_VIOLATIONS
@@ -93,21 +501,91 @@
94502 * and then checks if the specified flag is set. The main purpose
95503 * of this is to simplify the refresh pattern lookup
96504 */
97 -diff -urNad squid-2.7.6~/src/protos.h squid-2.7.6/src/protos.h
98 -+++ squid-2.7.6/src/protos.h 2009-02-12 20:13:01.000000000 +0000
99 -@@ -1468,7 +1468,7 @@
 505+@@ -1350,7 +1350,6 @@
 506+ }
 507+ }
 508+ /* append Cache-Control, add max-age if not there already */
 509+-#if 0
 510+ {
 511+ HttpHdrCc *cc = httpHeaderGetCc(hdr_in);
 512+ if (!cc)
 513+@@ -1370,7 +1369,6 @@
 514+ httpHeaderPutCc(hdr_out, cc);
 515+ httpHdrCcDestroy(cc);
 516+ }
 517+-#endif
 518+ /* maybe append Connection: keep-alive */
 519+ if (flags.keepalive || request->flags.pinned) {
 520+ if (flags.proxying) {
 521+diff -urNad squid-2.7.9~/src/main.c squid-2.7.9/src/main.c
 522+--- squid-2.7.9~/src/main.c 2011-04-11 20:17:44.000000000 +0000
 523+@@ -376,21 +376,6 @@
 524+ asnFreeMemory();
 525+ }
 526+
 527+-#if USE_UNLINKD
 528+-static int
 529+-needUnlinkd(void)
 530+-{
 531+- int i;
 532+- int r = 0;
 533+- for (i = 0; i < Config.cacheSwap.n_configured; i++) {
 534+- if (strcmp(Config.cacheSwap.swapDirs[i].type, "ufs") == 0 ||
 535+- strcmp(Config.cacheSwap.swapDirs[i].type, "diskd") == 0)
 536+- r++;
 537+- }
 538+- return r;
 539+-}
 540+-#endif
 541+-
 542+ static void
 543+ mainReconfigure(void)
 544+ {
 545+@@ -414,9 +399,6 @@
 546+ storeurlShutdown();
 547+ locationRewriteShutdown();
 548+ authenticateShutdown();
 549+-#if USE_UNLINKD
 550+- unlinkdClose();
 551+-#endif
 552+ externalAclShutdown();
 553+ refreshCheckShutdown();
 554+ storeDirSync(); /* Flush pending I/O ops */
 555+@@ -460,9 +442,6 @@
 556+ #if DELAY_POOLS
 557+ clientReassignDelaypools();
 558+ #endif
 559+-#if USE_UNLINKD
 560+- if (needUnlinkd()) unlinkdInit();
 561+-#endif
 562+ serverConnectionsOpen();
 563+ neighbors_init();
 564+ storeDirOpenSwapLogs();
 565+@@ -635,7 +614,7 @@
 566+
 567+ if (!configured_once) {
 568+ #if USE_UNLINKD
 569+- if (needUnlinkd()) unlinkdInit();
 570++ unlinkdInit();
 571+ #endif
 572+ urlInitialize();
 573+ cachemgrInit();
 574+diff -urNad squid-2.7.9~/src/protos.h squid-2.7.9/src/protos.h
 575+--- squid-2.7.9~/src/protos.h 2010-03-07 16:00:07.000000000 +0000
 576+@@ -1471,7 +1471,7 @@
100577 /* ETag support */
101578 void storeLocateVaryDone(VaryData * data);
102579 void storeLocateVary(StoreEntry * e, int offset, const char *vary_data, String accept_encoding, STLVCB * callback, void *cbdata);
103 --void storeAddVary(const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding);
104 -+vary_id_t storeAddVary(const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding);
 580+-void storeAddVary(const char *store_url, const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding);
 581++vary_id_t storeAddVary(const char *store_url, const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding);
105582
106583 /* New HTTP message parsing support */
107584 extern void HttpMsgBufInit(HttpMsgBuf * hmsg, const char *buf, size_t size);
108 -diff -urNad squid-2.7.6~/src/store.c squid-2.7.6/src/store.c
109 -+++ squid-2.7.6/src/store.c 2009-02-12 20:18:06.000000000 +0000
 585+diff -urNad squid-2.7.9~/src/store.c squid-2.7.9/src/store.c
 586+--- squid-2.7.9~/src/store.c 2010-02-14 00:45:52.000000000 +0000
110587 @@ -87,6 +87,7 @@
111588 static void storeEntryDereferenced(StoreEntry *);
112589 static int getKeyCounter(void);
@@ -116,7 +594,7 @@
117595 static OBJH storeCheckCachableStats;
118596 static EVH storeLateRelease;
119597
120 -@@ -347,8 +348,9 @@
 598+@@ -348,8 +349,9 @@
121599 StoreEntry *
122600 storeGet(const cache_key * key)
123601 {
@@ -128,44 +606,43 @@
129607 }
130608
131609 StoreEntry *
132 -@@ -452,6 +454,11 @@
 610+@@ -454,6 +456,11 @@
133611 storeAppendPrintf(state->e, "ETag: %s\n", state->etag);
134612 storeAppendPrintf(state->e, "VaryData: %s\n", state->vary_headers);
135613 }
136614 + if (state->oe) {
137615 + debug(11, 3)("free_AddVaryState: copying vary ID %ld.%u to new entry\n",
138 -+ state->oe->mem_obj->vary_id.create_time, state->oe->mem_obj->vary_id.serial);
 616++ state->oe->mem_obj->vary_id.create_time, state->oe->mem_obj->vary_id.serial);
139617 + state->e->mem_obj->vary_id = state->oe->mem_obj->vary_id;
140618 + }
141619 storeTimestampsSet(state->e);
142620 storeComplete(state->e);
143621 storeTimestampsSet(state->e);
144 -@@ -563,6 +570,7 @@
 622+@@ -566,6 +573,7 @@
145623 debug(11, 3) ("storeAddVaryReadOld: %p seen_offset=%" PRINTF_OFF_T " buf_offset=%d size=%d\n", data, state->seen_offset, (int) state->buf_offset, (int) size);
146624 if (size <= 0) {
147625 debug(11, 2) ("storeAddVaryReadOld: DONE\n");
148 -+ /* Call back to the destructor free_AddVaryState */
 626++ /* Call back to the destructor free_AddVaryState */
149627 cbdataFree(state);
150628 return;
151629 }
152 -@@ -706,12 +714,13 @@
153 -
 630+@@ -710,11 +718,13 @@
154631 /*
155632 * Adds/updates a Vary record.
156 -- * For updates only one of key or etag needs to be specified
 633+ * For updates only one of key or etag needs to be specified
157634 - * At leas one of key or etag must be specified, preferably both.
158635 + * At least one of key or etag must be specified, preferably both.
159636 + * Returns the vary ID if it can be determined immediately, zero otherwise
160637 */
161638 -void
162639 +vary_id_t
163 - storeAddVary(const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding)
 640+ storeAddVary(const char *store_url, const char *url, const method_t method, const cache_key * key, const char *etag, const char *vary, const char *vary_headers, const char *accept_encoding)
164641 {
165642 + vary_id_t vary_id = {0, 0};
166643 AddVaryState *state;
167644 request_flags flags = null_request_flags;
168645 CBDATA_INIT_TYPE_FREECB(AddVaryState, free_AddVaryState);
169 -@@ -734,6 +743,11 @@
 646+@@ -739,6 +749,11 @@
170647 httpReplySetHeaders(state->e->mem_obj->reply, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
171648 httpHeaderPutStr(&state->e->mem_obj->reply->header, HDR_VARY, vary);
172649 storeSetPublicKey(state->e);
@@ -177,24 +654,24 @@
178655 storeBuffer(state->e);
179656 httpReplySwapOut(state->e->mem_obj->reply, state->e);
180657 if (state->oe) {
181 -@@ -752,7 +766,15 @@
 658+@@ -757,7 +772,15 @@
182659 * modifications above)
183660 */
184661 /* Swap in the dummy Vary object */
185662 - if (!state->oe->mem_obj) {
186663 + if (state->oe->mem_obj) {
187 -+ vary_id = state->oe->mem_obj->vary_id;
188 -+ if (vary_id.create_time == 0 && vary_id.serial == 0) {
189 -+ initVaryId(&vary_id);
190 -+ state->oe->mem_obj->vary_id = vary_id;
 664++ vary_id = state->oe->mem_obj->vary_id;
 665++ if (vary_id.create_time == 0 && vary_id.serial == 0) {
 666++ initVaryId(&vary_id);
 667++ state->oe->mem_obj->vary_id = vary_id;
191668 + }
192669 + }
193670 + else {
194 -+ /* Swap in the dummy Vary object. vary_id is unknown for now */
 671++ /* Swap in the dummy Vary object. vary_id is unknown for now */
195672 storeCreateMemObject(state->oe, state->url);
196673 state->oe->mem_obj->method = method;
197674 }
198 -@@ -764,10 +786,10 @@
 675+@@ -769,10 +792,10 @@
199676 state->buf,
200677 storeAddVaryReadOld,
201678 state);
@@ -206,7 +683,7 @@
207684 }
208685
209686 static MemPool *VaryData_pool = NULL;
210 -@@ -810,9 +832,10 @@
 687+@@ -815,9 +838,10 @@
211688 static void
212689 storeLocateVaryCallback(LocateVaryState * state)
213690 {
@@ -218,7 +695,7 @@
219696 state->callback(data, state->callback_data);
220697 state->data = NULL; /* now owned by the caller */
221698 } else {
222 -@@ -989,6 +1012,7 @@
 699+@@ -994,6 +1018,7 @@
223700 StoreEntry *e2 = NULL;
224701 const cache_key *newkey;
225702 MemObject *mem = e->mem_obj;
@@ -226,7 +703,7 @@
227704 if (e->hash.key && !EBIT_TEST(e->flags, KEY_PRIVATE)) {
228705 if (EBIT_TEST(e->flags, KEY_EARLY_PUBLIC)) {
229706 EBIT_CLR(e->flags, KEY_EARLY_PUBLIC);
230 -@@ -1042,6 +1066,7 @@
 707+@@ -1047,6 +1072,7 @@
231708 newkey = storeKeyPublicByRequest(mem->request);
232709 if (mem->vary_headers && !EBIT_TEST(e->flags, KEY_EARLY_PUBLIC)) {
233710 String vary = StringNull;
@@ -234,47 +711,45 @@
235712 String varyhdr;
236713 varyhdr = httpHeaderGetList(&mem->reply->header, HDR_VARY);
237714 if (strBuf(varyhdr))
238 -@@ -1054,8 +1079,28 @@
 715+@@ -1059,7 +1085,27 @@
239716 strListAdd(&vary, strBuf(varyhdr), ',');
240717 stringClean(&varyhdr);
241718 #endif
242 -- storeAddVary(mem->url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
243 -- stringClean(&vary);
244 -+ /* Create or update the vary object */
245 -+ vary_id = storeAddVary(mem->url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
246 -+ if (vary_id.create_time) {
247 -+ mem->vary_id = vary_id;
248 -+ } else {
249 -+ /* Base vary object is not swapped in, so the vary_id is unknown.
250 -+ * Maybe we can cheat and use the vary_id from the request. If the
251 -+ * base object existed earlier in the request, it would have been
252 -+ * swapped in and stored at that time.
253 -+ */
254 -+ if (mem->request->vary_id.create_time) {
255 -+ mem->vary_id = mem->request->vary_id;
256 -+ } else {
257 -+ /* Nope, no luck. Store with zero vary_id, which will immediately
258 -+ * be treated as expired.
259 -+ * FIXME: make this work properly.
260 -+ */
261 -+ debug(20, 1) ("storeSetPublicKey: unable to determine vary_id for '%s'\n", mem->url);
262 -+ }
263 -+ }
 719+- storeAddVary(mem->store_url, mem->url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
 720++ /* Create or update the vary object */
 721++ vary_id = storeAddVary(mem->store_url, mem->url, mem->method, newkey, httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary), mem->vary_headers, mem->vary_encoding);
 722++ if (vary_id.create_time) {
 723++ mem->vary_id = vary_id;
 724++ } else {
 725++ /* Base vary object is not swapped in, so the vary_id is unknown.
 726++ * Maybe we can cheat and use the vary_id from the request. If the
 727++ * base object existed earlier in the request, it would have been
 728++ * swapped in and stored at that time.
 729++ */
 730++ if (mem->request->vary_id.create_time) {
 731++ mem->vary_id = mem->request->vary_id;
 732++ } else {
 733++ /* Nope, no luck. Store with zero vary_id, which will immediately
 734++ * be treated as expired.
 735++ * FIXME: make this work properly.
 736++ */
 737++ debug(20, 1) ("storeSetPublicKey: unable to determine vary_id for '%s'\n", mem->url);
 738++ }
 739++ }
264740 +
265 -+ stringClean(&vary);
 741+ stringClean(&vary);
266742 }
267743 } else {
268 - newkey = storeKeyPublic(storeLookupUrl(e), mem->method);
269 -@@ -1829,6 +1874,8 @@
 744+@@ -1834,6 +1880,8 @@
270745 debug(20, 1) ("MemObject->url: %p %s\n",
271746 mem->url,
272747 checkNullString(mem->url));
273748 + debug(20, 1) ("MemObject->vary_id: %ld.%u\n",
274 -+ mem->vary_id.create_time, mem->vary_id.serial);
 749++ mem->vary_id.create_time, mem->vary_id.serial);
275750 }
276751
277752 void
278 -@@ -2112,3 +2159,15 @@
 753+@@ -2117,3 +2165,15 @@
279754 if (e->mem_obj)
280755 e->mem_obj->serverfd = -1;
281756 }
@@ -290,9 +765,9 @@
291766 + vary_id->create_time = squid_curtime;
292767 + vary_id->serial = serial++;
293768 +}
294 -diff -urNad squid-2.7.6~/src/store_client.c squid-2.7.6/src/store_client.c
295 -+++ squid-2.7.6/src/store_client.c 2009-02-12 20:13:01.000000000 +0000
 769+diff -urNad squid-2.7.9~/src/store_client.c squid-2.7.9/src/store_client.c
 770+--- squid-2.7.9~/src/store_client.c 2009-09-16 20:55:26.000000000 +0000
296771 @@ -441,6 +441,9 @@
297772 mem->vary_headers = xstrdup(t->value);
298773 }
@@ -303,9 +778,9 @@
304779 default:
305780 debug(20, 2) ("WARNING: got unused STORE_META type %d\n", t->type);
306781 break;
307 -diff -urNad squid-2.7.6~/src/store_swapmeta.c squid-2.7.6/src/store_swapmeta.c
308 -+++ squid-2.7.6/src/store_swapmeta.c 2009-02-12 20:13:01.000000000 +0000
 782+diff -urNad squid-2.7.9~/src/store_swapmeta.c squid-2.7.9/src/store_swapmeta.c
 783+--- squid-2.7.9~/src/store_swapmeta.c 2008-05-27 12:49:39.000000000 +0000
309784 @@ -86,6 +86,7 @@
310785 vary = e->mem_obj->vary_headers;
311786 if (vary)
@@ -314,9 +789,9 @@
315790 if (e->mem_obj->store_url)
316791 T = storeSwapTLVAdd(STORE_META_STOREURL, e->mem_obj->store_url, strlen(e->mem_obj->store_url) + 1, T);
317792 return TLV;
318 -diff -urNad squid-2.7.6~/src/structs.h squid-2.7.6/src/structs.h
319 -+++ squid-2.7.6/src/structs.h 2009-02-12 20:13:01.000000000 +0000
 793+diff -urNad squid-2.7.9~/src/structs.h squid-2.7.9/src/structs.h
 794+--- squid-2.7.9~/src/structs.h 2008-09-25 02:33:37.000000000 +0000
320795 @@ -1732,6 +1732,11 @@
321796 void (*Done) (RemovalPurgeWalker * walker);
322797 };
@@ -341,14 +816,14 @@
342817 char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */
343818 String vary_encoding; /* Used when varying entities are detected. Changes how the store key is calculated. */
344819 VaryData *vary;
345 -+ vary_id_t vary_id; /* Vary ID of the parent vary object */
 820++ vary_id_t vary_id;
346821 Array *etags; /* possible known entity tags (Vary MISS) */
347822 char *etag; /* current entity tag, cache validation */
348823 unsigned int done_etag:1; /* We have done clientProcessETag on this, don't attempt it again */
349 -diff -urNad squid-2.7.6~/src/typedefs.h squid-2.7.6/src/typedefs.h
350 -+++ squid-2.7.6/src/typedefs.h 2009-02-12 20:13:01.000000000 +0000
351 -@@ -226,6 +226,7 @@
 824+diff -urNad squid-2.7.9~/src/typedefs.h squid-2.7.9/src/typedefs.h
 825+--- squid-2.7.9~/src/typedefs.h 2010-02-12 20:22:18.000000000 +0000
 826+@@ -214,6 +214,7 @@
352827 typedef struct _RemovalPolicySettings RemovalPolicySettings;
353828 typedef struct _errormap errormap;
354829 typedef struct _PeerMonitor PeerMonitor;
@@ -356,3 +831,15 @@
357832
358833 typedef struct _http_version_t http_version_t;
359834
 835+diff -urNad squid-2.7.9~/src/url.c squid-2.7.9/src/url.c
 836+--- squid-2.7.9~/src/url.c 2011-04-11 20:17:44.000000000 +0000
 837+@@ -364,7 +364,7 @@
 838+ debug(23, 1) ("urlParse: Illegal character in hostname '%s'\n", host);
 839+ return NULL;
 840+ }
 841+- if (Config.appendDomain && !strchr(host, '.')&& strcasecmp(host,"localhost") != 0)
 842++ if (Config.appendDomain && !strchr(host, '.'))
 843+ strncat(host, Config.appendDomain, SQUIDHOSTNAMELEN - strlen(host) - 1);
 844+ /* remove trailing dots from hostnames */
 845+ while ((l = strlen(host)) > 0 && host[--l] == '.')
Index: trunk/debs/squid/debian/patches/27-malformed-requests-memoryleak.dpatch
@@ -0,0 +1,45 @@
 2+#! /bin/sh /usr/share/dpatch/dpatch-run
 3+## 27-malformed-requests-memoryleak.dpatch
 4+##
 5+## All lines beginning with `## DP:' are a description of the patch.
 6+## DP: Bug 2973: memoryleak on maformed requests
 7+
 8+@DPATCH@
 9+
 10+---------------------
 11+PatchSet 12697
 12+Date: 2010/07/13 19:43:08
 13+Author: hno
 14+Branch: SQUID_2_7
 15+Tag: (none)
 16+Log:
 17+Bug 2973: memoryleak on maformed requests
 18+
 19+Members:
 20+ src/client_side.c:1.754.2.29->1.754.2.30
 21+
 22+Index: squid/src/client_side.c
 23+===================================================================
 24+RCS file: /cvsroot/squid/squid/src/client_side.c,v
 25+retrieving revision 1.754.2.29
 26+retrieving revision 1.754.2.30
 27+diff -u -r1.754.2.29 -r1.754.2.30
 28+--- squid/src/client_side.c 14 Feb 2010 00:46:25 -0000 1.754.2.29
 29+@@ -1,6 +1,6 @@
 30+
 31+ /*
 32+- * $Id: client_side.c,v 1.754.2.29 2010/02/14 00:46:25 hno Exp $
 33++ * $Id: client_side.c,v 1.754.2.30 2010/07/13 19:43:08 hno Exp $
 34+ *
 35+ * DEBUG: section 33 Client-side Routines
 36+ * AUTHOR: Duane Wessels
 37+@@ -3063,6 +3063,7 @@
 38+ if (mb.size > 0) {
 39+ comm_write_mbuf(http->conn->fd, mb, clientWriteComplete, http);
 40+ } else {
 41++ memBufClean(&mb);
 42+ storeClientCopy(http->sc, http->entry,
 43+ http->out.offset,
 44+ http->out.offset,
 45+
Property changes on: trunk/debs/squid/debian/patches/27-malformed-requests-memoryleak.dpatch
___________________________________________________________________
Added: svn:executable
146 + *
Index: trunk/debs/squid/debian/patches/29-rfc1738_unescape.dpatch
@@ -0,0 +1,27 @@
 2+#! /bin/sh /usr/share/dpatch/dpatch-run
 3+## 29-rfc1738_unescape.dpatch by Tim Starling <tstarling@wikimedia.org>
 4+##
 5+## All lines beginning with `## DP:' are a description of the patch.
 6+## DP: Fix for mediawiki bug 28517
 7+
 8+@DPATCH@
 9+diff -urNad squid-2.7.9~/src/acl.c squid-2.7.9/src/acl.c
 10+--- squid-2.7.9~/src/acl.c 2008-05-04 23:23:13.000000000 +0000
 11+@@ -1875,14 +1875,14 @@
 12+ /* NOTREACHED */
 13+ case ACL_URLPATH_REGEX:
 14+ esc_buf = xstrdup(strBuf(r->urlpath));
 15+- rfc1738_unescape(esc_buf);
 16++ /*rfc1738_unescape(esc_buf);*/
 17+ k = aclMatchRegex(ae->data, esc_buf);
 18+ safe_free(esc_buf);
 19+ return k;
 20+ /* NOTREACHED */
 21+ case ACL_URL_REGEX:
 22+ esc_buf = xstrdup(urlCanonical(r));
 23+- rfc1738_unescape(esc_buf);
 24++ /*rfc1738_unescape(esc_buf);*/
 25+ k = aclMatchRegex(ae->data, esc_buf);
 26+ safe_free(esc_buf);
 27+ return k;
Property changes on: trunk/debs/squid/debian/patches/29-rfc1738_unescape.dpatch
___________________________________________________________________
Added: svn:executable
128 + *
Index: trunk/debs/squid/debian/patches/00list
@@ -6,4 +6,8 @@
77 21-nomangle-requestCC
88 23-variant-invalidation
99 25-coss-remove-swap-log
10 -26-vary_options.dpatch
 10+26-vary_options
 11+27-malformed-requests-memoryleak
 12+28-retry-options
 13+29-rfc1738_unescape
 14+30-multicast-udp
Index: trunk/debs/squid/debian/patches/30-multicast-udp.dpatch
@@ -0,0 +1,62 @@
 2+#! /bin/sh /usr/share/dpatch/dpatch-run
 3+## 30-multicast-udp.dpatch by <root@ragweed.knams.wikimedia.org>
 4+##
 5+## All lines beginning with `## DP:' are a description of the patch.
 6+## DP: No description.
 7+
 8+@DPATCH@
 9+diff -urNad squid-2.7.9~/src/cf.data.pre squid-2.7.9/src/cf.data.pre
 10+--- squid-2.7.9~/src/cf.data.pre 2011-04-18 22:44:02.000000000 +0000
 11+@@ -5712,5 +5712,13 @@
 12+ Note: after changing this, Squid service must be restarted.
 13+ DOC_END
 14+
 15++NAME: udplog_multicast_ttl
 16++COMMENT: (seconds)
 17++TYPE: int
 18++LOC: Config.udplog_multicast_ttl
 19++DEFAULT: 1
 20++DOC_START
 21++ The value of IP_MULTICAST_TTL when sending udp logs with multicast UDP.
 22++DOC_END
 23+
 24+ EOF
 25+diff -urNad squid-2.7.9~/src/logfile_mod_udp.c squid-2.7.9/src/logfile_mod_udp.c
 26+--- squid-2.7.9~/src/logfile_mod_udp.c 2008-06-04 20:36:17.000000000 +0000
 27+@@ -151,6 +151,8 @@
 28+ l_udp_t *ll;
 29+ struct sockaddr_in addr;
 30+ char *strAddr;
 31++ struct in_addr iaddr;
 32++ u_char ttl = (u_char)Config.udplog_multicast_ttl;
 33+
 34+ lf->f_close = logfile_mod_udp_close;
 35+ lf->f_linewrite = logfile_mod_udp_writeline;
 36+@@ -183,6 +185,14 @@
 37+ 0,
 38+ COMM_NONBLOCKING,
 39+ "UDP log socket");
 40++ // Check for multicast address (first four address bits: 1110)
 41++ if ((ntohl(addr.sin_addr.s_addr) >> 28) == 0xe) {
 42++ iaddr.s_addr = INADDR_ANY; // use DEFAULT interface
 43++ setsockopt(ll->fd, IPPROTO_IP, IP_MULTICAST_IF, &iaddr,
 44++ sizeof(struct in_addr));
 45++ setsockopt(ll->fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl,
 46++ sizeof(unsigned char));
 47++ }
 48+ if (ll->fd < 0) {
 49+ if (lf->flags.fatal) {
 50+ fatalf("Unable to open UDP socket for logging\n");
 51+diff -urNad squid-2.7.9~/src/structs.h squid-2.7.9/src/structs.h
 52+--- squid-2.7.9~/src/structs.h 2011-04-18 22:44:02.000000000 +0000
 53+@@ -843,6 +843,7 @@
 54+ int max_filedescriptors;
 55+ char *accept_filter;
 56+ int incoming_rate;
 57++ int udplog_multicast_ttl;
 58+ };
 59+
 60+ struct _SquidConfig2 {
Property changes on: trunk/debs/squid/debian/patches/30-multicast-udp.dpatch
___________________________________________________________________
Added: svn:executable
161 + *
Index: trunk/debs/squid/debian/changelog
@@ -1,3 +1,56 @@
 2+squid (2.7.9-7wm1) lucid-wikimedia; urgency=low
 3+
 4+ [ Ryan Lane ]
 5+ * Adding patch for udp multicast logging
 6+
 7+ -- Ryan Lane <rlane@wikimedia.org> Mon, 18 Apr 2011 21:14:00 +0000
 8+
 9+squid (2.7.9-6wm1) lucid-wikimedia; urgency=low
 10+
 11+ [ Ryan Lane ]
 12+ * Adding config option back in for maximum_forwards
 13+
 14+ -- Ryan Lane <rlane@wikimedia.org> Tue, 13 Apr 2011 18:52:00 +0000
 15+
 16+squid (2.7.9-5wm1) lucid-wikimedia; urgency=low
 17+
 18+ [ Ryan Lane ]
 19+ * Added patches to list
 20+
 21+ -- Ryan Lane <rlane@wikimedia.org> Tue, 12 Apr 2011 23:30:00 +0000
 22+
 23+squid (2.7.9-4wm1) lucid-wikimedia; urgency=low
 24+
 25+ [ Ryan Lane ]
 26+ * Change hardcoded value of maximum_forwards and remove config option
 27+
 28+ [ Tim Starling ]
 29+ * Fix for mediawiki bug 28517
 30+
 31+ -- Ryan Lane <rlane@wikimedia.org> Tue, 12 Apr 2011 21:27:00 +0000
 32+
 33+squid (2.7.9-3wm1) lucid-wikimedia; urgency=low
 34+
 35+ [ Ryan Lane ]
 36+ * Adjust maximum_forwards configuration option
 37+
 38+ -- Ryan Lane <rlane@wikimedia.org> Tue, 12 Apr 2011 21:27:00 +0000
 39+
 40+squid (2.7.9-2wm1) lucid-wikimedia; urgency=low
 41+
 42+ [ Ryan Lane ]
 43+ * Patch to add maximum_forwards configuration option
 44+
 45+ -- Ryan Lane <rlane@wikimedia.org> Tue, 12 Apr 2011 19:00:00 +0000
 46+
 47+squid (2.7.9-1wm1) lucid-wikimedia; urgency=low
 48+
 49+ [ Ryan Lane ]
 50+ * Upgrade to upstream version 2.7.9
 51+ * Patch for memory leak in malformed requests
 52+
 53+ -- Ryan Lane <rlane@wikimedia.org> Fri, 08 Apr 2011 18:24:00 +0000
 54+
255 squid (2.7.7-1wm1) karmic; urgency=low
356
457 [ Tim Starling ]

Status & tagging log