]> git.pld-linux.org Git - packages/squid.git/blame - squid-2.5.STABLE10-internal_date.patch
- updated to 2.5.STABLE11
[packages/squid.git] / squid-2.5.STABLE10-internal_date.patch
CommitLineData
d29ec517 1Index: squid/include/Array.h
2diff -c squid/include/Array.h:1.6 squid/include/Array.h:1.6.2.1
3*** squid/include/Array.h:1.6 Mon Oct 8 10:18:31 2001
4--- squid/include/Array.h Thu Jun 9 01:51:46 2005
5***************
6*** 48,53 ****
7--- 48,54 ----
8 extern void arrayClean(Array * s);
9 extern void arrayDestroy(Array * s);
10 extern void arrayAppend(Array * s, void *obj);
11+ extern void arrayInsert(Array * s, void *obj, int position);
12 extern void arrayPreAppend(Array * s, int app_count);
13
14
15Index: squid/lib/Array.c
16diff -c squid/lib/Array.c:1.7 squid/lib/Array.c:1.7.2.1
17*** squid/lib/Array.c:1.7 Wed Feb 7 11:56:50 2001
18--- squid/lib/Array.c Thu Jun 9 01:51:46 2005
19***************
20*** 95,100 ****
21--- 95,113 ----
22 a->items[a->count++] = obj;
23 }
24
25+ void arrayInsert(Array *a, void *obj, int position)
26+ {
27+ assert(a);
28+ if (a->count >= a->capacity)
29+ arrayGrow(a, a->count + 1);
30+ if (position > a->count)
31+ position = a->count;
32+ if (position < a->count)
33+ memmove(&a->items[position + 1], &a->items[position], (a->count - position) * sizeof(void *));
34+ a->items[position] = obj;
35+ a->count++;
36+ }
37+
38 /* if you are going to append a known and large number of items, call this first */
39 void
40 arrayPreAppend(Array * a, int app_count)
41Index: squid/src/HttpHeader.c
42diff -c squid/src/HttpHeader.c:1.74.2.29 squid/src/HttpHeader.c:1.74.2.30
43*** squid/src/HttpHeader.c:1.74.2.29 Wed May 25 16:57:33 2005
44--- squid/src/HttpHeader.c Thu Jun 9 01:51:46 2005
45***************
46*** 680,685 ****
47--- 680,705 ----
48 hdr->len += strLen(e->name) + 2 + strLen(e->value) + 2;
49 }
50
51+ /* inserts an entry at the given position;
52+ * does not call httpHeaderEntryClone() so one should not reuse "*e"
53+ */
54+ void
55+ httpHeaderInsertEntry(HttpHeader * hdr, HttpHeaderEntry * e, int pos)
56+ {
57+ assert(hdr && e);
58+ assert_eid(e->id);
59+
60+ debug(55, 7) ("%p adding entry: %d at %d\n",
61+ hdr, e->id, hdr->entries.count);
62+ if (CBIT_TEST(hdr->mask, e->id))
63+ Headers[e->id].stat.repCount++;
64+ else
65+ CBIT_SET(hdr->mask, e->id);
66+ arrayInsert(&hdr->entries, e, pos);
67+ /* increment header length, allow for ": " and crlf */
68+ hdr->len += strLen(e->name) + 2 + strLen(e->value) + 2;
69+ }
70+
71 /* return a list of entries with the same id separated by ',' and ws */
72 String
73 httpHeaderGetList(const HttpHeader * hdr, http_hdr_type id)
74***************
75*** 850,855 ****
76--- 870,884 ----
77 }
78
79 void
80+ httpHeaderInsertTime(HttpHeader * hdr, int pos, http_hdr_type id, time_t htime)
81+ {
82+ assert_eid(id);
83+ assert(Headers[id].type == ftDate_1123); /* must be of an appropriate type */
84+ assert(htime >= 0);
85+ httpHeaderInsertEntry(hdr, httpHeaderEntryCreate(id, NULL, mkrfc1123(htime)), pos);
86+ }
87+
88+ void
89 httpHeaderPutStr(HttpHeader * hdr, http_hdr_type id, const char *str)
90 {
91 assert_eid(id);
92Index: squid/src/cf.data.pre
93diff -c squid/src/cf.data.pre:1.245.2.94 squid/src/cf.data.pre:1.245.2.95
94*** squid/src/cf.data.pre:1.245.2.94 Tue May 10 17:08:40 2005
95--- squid/src/cf.data.pre Thu Jun 9 01:51:46 2005
96***************
97*** 3241,3246 ****
98--- 3241,3260 ----
99 @DEFAULT_ICON_DIR@
100 DOC_END
101
102+ NAME: global_internal_static
103+ TYPE: onoff
104+ LOC: Config.onoff.global_internal_static
105+ DEFAULT: on
106+ DOC_START
107+ This directive controls is Squid should intercept all requests for
108+ /squid-internal-static/ no matter which host the URL is requesting
109+ (default on setting), or if nothing special should be done for
110+ such URLs (off setting). The purpose of this directive is to make
111+ icons etc work better in complex cache hierarchies where it may
112+ not always be possible for all corners in the cache mesh to reach
113+ the server generating a directory listing.
114+ DOC_END
115+
116 NAME: short_icon_urls
117 TYPE: onoff
118 LOC: Config.icons.use_short_names
119Index: squid/src/client_side.c
120diff -c squid/src/client_side.c:1.561.2.76 squid/src/client_side.c:1.561.2.77
121*** squid/src/client_side.c:1.561.2.76 Wed Apr 20 15:46:06 2005
122--- squid/src/client_side.c Thu Jun 9 01:51:47 2005
123***************
124*** 1404,1410 ****
125 (void) 0;
126 else if (http->entry->timestamp < 0)
127 (void) 0;
128! else if (http->entry->timestamp < squid_curtime)
129 httpHeaderPutInt(hdr, HDR_AGE,
130 squid_curtime - http->entry->timestamp);
131 }
132--- 1404,1413 ----
133 (void) 0;
134 else if (http->entry->timestamp < 0)
135 (void) 0;
136! if (EBIT_TEST(http->entry->flags, ENTRY_SPECIAL)) {
137! httpHeaderDelById(hdr, HDR_DATE);
138! httpHeaderInsertTime(hdr, 0, HDR_DATE, squid_curtime);
139! } else if (http->entry->timestamp < squid_curtime)
140 httpHeaderPutInt(hdr, HDR_AGE,
141 squid_curtime - http->entry->timestamp);
142 }
143***************
144*** 2719,2729 ****
145 *t = '\0';
146 #endif
147
148! /* handle internal objects */
149! if (internalCheck(url)) {
150 /* prepend our name & port */
151 http->uri = xstrdup(internalLocalUri(NULL, url));
152- http->flags.internal = 1;
153 http->flags.accel = 1;
154 }
155 /* see if we running in Config2.Accel.on, if so got to convert it to URL */
156--- 2722,2731 ----
157 *t = '\0';
158 #endif
159
160! /* handle direct internal objects */
161! if (!Config2.Accel.on && internalCheck(url)) {
162 /* prepend our name & port */
163 http->uri = xstrdup(internalLocalUri(NULL, url));
164 http->flags.accel = 1;
165 }
166 /* see if we running in Config2.Accel.on, if so got to convert it to URL */
167***************
168*** 3099,3105 ****
169 if (internalHostnameIs(request->host) &&
170 request->port == ntohs(Config.Sockaddr.http->s.sin_port)) {
171 http->flags.internal = 1;
172! } else if (internalStaticCheck(strBuf(request->urlpath))) {
173 xstrncpy(request->host, internalHostname(), SQUIDHOSTNAMELEN);
174 request->port = ntohs(Config.Sockaddr.http->s.sin_port);
175 http->flags.internal = 1;
176--- 3101,3107 ----
177 if (internalHostnameIs(request->host) &&
178 request->port == ntohs(Config.Sockaddr.http->s.sin_port)) {
179 http->flags.internal = 1;
180! } else if (Config.onoff.global_internal_static && internalStaticCheck(strBuf(request->urlpath))) {
181 xstrncpy(request->host, internalHostname(), SQUIDHOSTNAMELEN);
182 request->port = ntohs(Config.Sockaddr.http->s.sin_port);
183 http->flags.internal = 1;
184Index: squid/src/protos.h
185diff -c squid/src/protos.h:1.420.2.35 squid/src/protos.h:1.420.2.36
186*** squid/src/protos.h:1.420.2.35 Wed May 18 09:28:32 2005
187--- squid/src/protos.h Thu Jun 9 01:51:47 2005
188***************
189*** 424,429 ****
190--- 424,430 ----
191 extern void httpHeaderPutInt(HttpHeader * hdr, http_hdr_type type, int number);
192 extern void httpHeaderPutSize(HttpHeader * hdr, http_hdr_type type, squid_off_t number);
193 extern void httpHeaderPutTime(HttpHeader * hdr, http_hdr_type type, time_t htime);
194+ extern void httpHeaderInsertTime(HttpHeader * hdr, int pos, http_hdr_type type, time_t htime);
195 extern void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str);
196 extern void httpHeaderPutAuth(HttpHeader * hdr, const char *auth_scheme, const char *realm);
197 extern void httpHeaderPutCc(HttpHeader * hdr, const HttpHdrCc * cc);
198***************
199*** 453,458 ****
200--- 454,460 ----
201 extern HttpHeaderEntry *httpHeaderGetEntry(const HttpHeader * hdr, HttpHeaderPos * pos);
202 extern HttpHeaderEntry *httpHeaderFindEntry(const HttpHeader * hdr, http_hdr_type id);
203 extern void httpHeaderAddEntry(HttpHeader * hdr, HttpHeaderEntry * e);
204+ extern void httpHeaderInsertEntry(HttpHeader * hdr, HttpHeaderEntry * e, int pos);
205 extern HttpHeaderEntry *httpHeaderEntryClone(const HttpHeaderEntry * e);
206 extern void httpHeaderEntryPackInto(const HttpHeaderEntry * e, Packer * p);
207 /* store report about current header usage and other stats */
208Index: squid/src/structs.h
209diff -c squid/src/structs.h:1.408.2.43 squid/src/structs.h:1.408.2.44
210*** squid/src/structs.h:1.408.2.43 Wed May 4 12:03:47 2005
211--- squid/src/structs.h Thu Jun 9 01:51:47 2005
212***************
213*** 609,614 ****
214--- 609,615 ----
215 int relaxed_header_parser;
216 int accel_uses_host_header;
217 int accel_no_pmtu_disc;
218+ int global_internal_static;
219 } onoff;
220 acl *aclList;
221 struct {
This page took 0.052211 seconds and 4 git commands to generate.