]> git.pld-linux.org Git - packages/squid.git/blob - squid-2.5.STABLE5-vary_negatively.patch
- patches from website
[packages/squid.git] / squid-2.5.STABLE5-vary_negatively.patch
1 Index: squid/src/http.c
2 diff -c squid/src/http.c:1.384.2.14 squid/src/http.c:1.384.2.15
3 *** squid/src/http.c:1.384.2.14 Sun Apr 18 17:43:30 2004
4 --- squid/src/http.c    Sat Apr 24 08:07:08 2004
5 ***************
6 *** 442,476 ****
7       debug(11, 3) ("httpProcessReplyHeader: HTTP CODE: %d\n", reply->sline.status);
8       if (neighbors_do_private_keys)
9         httpMaybeRemovePublic(entry, reply->sline.status);
10 !     switch (httpCachableReply(httpState)) {
11 !     case 1:
12 !       if (httpHeaderHas(&reply->header, HDR_VARY)
13   #if X_ACCELERATOR_VARY
14 !           || httpHeaderHas(&reply->header, HDR_X_ACCELERATOR_VARY)
15   #endif
16 !           ) {
17 !           const char *vary = httpMakeVaryMark(httpState->orig_request, reply);
18 !           if (vary) {
19 !               entry->mem_obj->vary_headers = xstrdup(vary);
20 !               /* Kill the old base object if a change in variance is detected */
21 !               httpMakePublic(entry);
22 !           } else {
23 !               httpMakePrivate(entry);
24 !           }
25 !       } else {
26 !           httpMakePublic(entry);
27         }
28         break;
29       case 0:
30         httpMakePrivate(entry);
31         break;
32       case -1:
33 !       httpCacheNegatively(entry);
34         break;
35       default:
36         assert(0);
37         break;
38       }
39       if (reply->cache_control) {
40         if (EBIT_TEST(reply->cache_control->mask, CC_PROXY_REVALIDATE))
41             EBIT_SET(entry->flags, ENTRY_REVALIDATE);
42 --- 442,477 ----
43       debug(11, 3) ("httpProcessReplyHeader: HTTP CODE: %d\n", reply->sline.status);
44       if (neighbors_do_private_keys)
45         httpMaybeRemovePublic(entry, reply->sline.status);
46 !     if (httpHeaderHas(&reply->header, HDR_VARY)
47   #if X_ACCELERATOR_VARY
48 !       || httpHeaderHas(&reply->header, HDR_X_ACCELERATOR_VARY)
49   #endif
50 !       ) {
51 !       const char *vary = httpMakeVaryMark(httpState->orig_request, reply);
52 !       if (!vary) {
53 !           httpMakePrivate(entry);
54 !           goto no_cache;
55         }
56 +       entry->mem_obj->vary_headers = xstrdup(vary);
57 +     }
58 +     switch (httpCachableReply(httpState)) {
59 +     case 1:
60 +       httpMakePublic(entry);
61         break;
62       case 0:
63         httpMakePrivate(entry);
64         break;
65       case -1:
66 !       if (Config.negativeTtl > 0)
67 !           httpCacheNegatively(entry);
68 !       else
69 !           httpMakePrivate(entry);
70         break;
71       default:
72         assert(0);
73         break;
74       }
75 +   no_cache:
76       if (reply->cache_control) {
77         if (EBIT_TEST(reply->cache_control->mask, CC_PROXY_REVALIDATE))
78             EBIT_SET(entry->flags, ENTRY_REVALIDATE);
This page took 0.056686 seconds and 4 git commands to generate.