Gentoo Archives: gentoo-commits

From: "Alin Nastac (mrness)" <mrness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-proxy/squid/files: squid-2.6.18-ToS_Hit_ToS_Preserve.patch squid-2.6.18-gentoo.patch squid-2.6.18-qos.patch digest-squid-2.6.18
Date: Thu, 10 Jan 2008 20:47:04
Message-Id: E1JD4Hy-00065g-DG@stork.gentoo.org
1 mrness 08/01/10 20:46:10
2
3 Added: squid-2.6.18-ToS_Hit_ToS_Preserve.patch
4 squid-2.6.18-gentoo.patch squid-2.6.18-qos.patch
5 digest-squid-2.6.18
6 Log:
7 Version bump (#205240).
8 (Portage version: 2.1.3.19)
9
10 Revision Changes Path
11 1.1 net-proxy/squid/files/squid-2.6.18-ToS_Hit_ToS_Preserve.patch
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.18-ToS_Hit_ToS_Preserve.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.18-ToS_Hit_ToS_Preserve.patch?rev=1.1&content-type=text/plain
15
16 Index: squid-2.6.18-ToS_Hit_ToS_Preserve.patch
17 ===================================================================
18 diff -Nru squid-2.6.STABLE18.orig/src/cf.data.pre squid-2.6.STABLE18/src/cf.data.pre
19 --- squid-2.6.STABLE18.orig/src/cf.data.pre 2008-01-10 22:29:22.000000000 +0200
20 +++ squid-2.6.STABLE18/src/cf.data.pre 2008-01-10 22:33:03.000000000 +0200
21 @@ -1181,6 +1181,64 @@
22 to off when using this directive in such configurations.
23 DOC_END
24
25 +NAME: zph_tos_local
26 +TYPE: int
27 +DEFAULT: 0
28 +LOC: Config.zph_tos_local
29 +DOC_START
30 + Allows you to select a TOS/Diffserv value to mark local hits. Read above
31 + (tcp_outgoing_tos) for details/requirements about TOS.
32 + Default: 0 (disabled).
33 +DOC_END
34 +
35 +NAME: zph_tos_peer
36 +TYPE: int
37 +DEFAULT: 0
38 +LOC: Config.zph_tos_peer
39 +DOC_START
40 + Allows you to select a TOS/Diffserv value to mark peer hits. Read above
41 + (tcp_outgoing_tos) for details/requirements about TOS.
42 + Default: 0 (disabled).
43 +DOC_END
44 +
45 +NAME: zph_tos_parent
46 +COMMENT: on|off
47 +TYPE: onoff
48 +LOC: Config.onoff.zph_tos_parent
49 +DEFAULT: on
50 +DOC_START
51 + Set this to off if you want only sibling hits to be marked.
52 + If set to on (default), parent hits are being marked too.
53 +DOC_END
54 +
55 +NAME: zph_preserve_miss_tos
56 +COMMENT: on|off
57 +TYPE: onoff
58 +LOC: Config.onoff.zph_preserve_miss_tos
59 +DEFAULT: on
60 +DOC_START
61 + If set to on (default), any HTTP response towards clients will
62 + have the TOS value of the response comming from the remote
63 + server masked with the value of zph_preserve_miss_tos_mask.
64 + For this to work correctly, you will need to patch your linux
65 + kernel with the TOS preserving ZPH patch.
66 + Has no effect under FreeBSD, works only under linux ZPH patched
67 + kernels.
68 +DOC_END
69 +
70 +NAME: zph_preserve_miss_tos_mask
71 +TYPE: int
72 +DEFAULT: 255
73 +LOC: Config.zph_preserve_miss_tos_mask
74 +DOC_START
75 + Allows you to mask certain bits in the TOS received from the
76 + remote server, before copying the value to the TOS send towards
77 + clients.
78 + See zph_preserve_miss_tos for details.
79 +
80 + Default: 255 (TOS from server is not changed).
81 +DOC_END
82 +
83 NAME: tcp_outgoing_address
84 TYPE: acl_address
85 DEFAULT: none
86 diff -Nru squid-2.6.STABLE18.orig/src/client_side.c squid-2.6.STABLE18/src/client_side.c
87 --- squid-2.6.STABLE18.orig/src/client_side.c 2008-01-10 22:29:22.000000000 +0200
88 +++ squid-2.6.STABLE18/src/client_side.c 2008-01-10 22:33:03.000000000 +0200
89 @@ -2632,6 +2632,55 @@
90 return;
91 }
92 assert(http->out.offset == 0);
93 +
94 + if ( Config.zph_tos_local || Config.zph_tos_peer ||
95 + (Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask) )
96 + {
97 + int need_change = 0;
98 + int hit = 0;
99 + int tos = 0;
100 + int tos_old = 0;
101 + int tos_len = sizeof(tos_old);
102 + int res;
103 +
104 + if (Config.zph_tos_local && isTcpHit(http->log_type)) { /* local hit */
105 + hit = 1;
106 + tos = Config.zph_tos_local;
107 + } else if (Config.zph_tos_peer &&
108 + (http->request->hier.code == SIBLING_HIT || /* sibling hit */
109 + (Config.onoff.zph_tos_parent &&
110 + http->request->hier.code == PARENT_HIT))) { /* parent hit */
111 + hit = 1;
112 + tos = Config.zph_tos_peer;
113 + }
114 + if (http->request->flags.proxy_keepalive) {
115 + if (getsockopt(fd, IPPROTO_IP, IP_TOS, &tos_old, &tos_len) < 0) {
116 + debug(33, 1) ("ZPH: getsockopt(IP_TOS) on FD %d: %s\n", fd, xstrerror());
117 + } else if (hit && tos_old != tos) { /* HIT: 1-st request, or previous was MISS, */
118 + need_change = 1; /* or local/parent hit change */
119 + } else if (!hit && (tos_old || /* MISS: previous was HIT */
120 + Config.onoff.zph_preserve_miss_tos)) { /* TOS copying is on */
121 +#if defined(_SQUID_LINUX_)
122 + if ( Config.onoff.zph_preserve_miss_tos ) {
123 + tos = (entry->mem_obj != NULL) ?
124 + (entry->mem_obj->recvTOS & Config.zph_preserve_miss_tos_mask):0;
125 + } else tos = 0;
126 +#else
127 + tos = 0;
128 +#endif
129 + need_change = 1;
130 + }
131 + } else if (hit) { /* no keepalive */
132 + need_change = 1;
133 + }
134 + if (need_change) {
135 + if (!hit) enter_suid(); /* Setting TOS bit6-7 is privilleged */
136 + res = setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
137 + if (!hit) leave_suid(); /* Setting bit5-7 is privilleged */
138 + if ( res < 0)
139 + debug(33, 1) ("ZPH: setsockopt(IP_TOS) on FD %d: %s\n", fd, xstrerror());
140 + }
141 + }
142 rep = http->reply = clientBuildReply(http, buf, size);
143 if (!rep) {
144 /* Forward as HTTP/0.9 body with no reply */
145 diff -Nru squid-2.6.STABLE18.orig/src/http.c squid-2.6.STABLE18/src/http.c
146 --- squid-2.6.STABLE18.orig/src/http.c 2007-11-26 13:04:30.000000000 +0200
147 +++ squid-2.6.STABLE18/src/http.c 2008-01-10 22:33:03.000000000 +0200
148 @@ -1393,6 +1393,53 @@
149 peer *p = httpState->peer;
150 CWCB *sendHeaderDone;
151 int fd = httpState->fd;
152 +
153 +#if defined(_SQUID_LINUX_)
154 +/* ZPH patch starts here (M.Stavrev 25-05-2005)
155 + * Retrieve connection peer's TOS value (which its SYN_ACK TCP segment
156 + * was encapsulated into an IP packet)
157 + */
158 + int tos, tos_len;
159 + if ( entry && entry->mem_obj ) { // Is this check necessary ? Seems not, but
160 + // have no time to investigate further.
161 + entry->mem_obj->recvTOS = 0;
162 + tos = 1;
163 + tos_len = sizeof(tos);
164 + if ( setsockopt(fd,SOL_IP, IP_RECVTOS, &tos, tos_len) == 0 ) {
165 + unsigned char buf[128];
166 + int len = 128;
167 + if (getsockopt(fd, SOL_IP, IP_PKTOPTIONS, buf, &len) == 0)
168 + {
169 + /* Parse the PKTOPTIONS structure to locate the TOS data message
170 + * prepared in the kernel by the ZPH incoming TCP TOS preserving
171 + * patch. In 99,99% the TOS should be located at buf[12], but
172 + * let's do it the right way.
173 + */
174 + unsigned char * p = buf;
175 + while ( p-buf < len ) {
176 + struct cmsghdr * o = (struct cmsghdr*)p;
177 + if ( o->cmsg_len <= 0 || o->cmsg_len > 52 )
178 + break;
179 + if ( o->cmsg_level == SOL_IP && o->cmsg_type == IP_TOS ) {
180 + entry->mem_obj->recvTOS = (unsigned char)(*(int*)
181 + (p + sizeof(struct cmsghdr)));
182 + debug(11, 5) ("ZPH: Incomming TOS=%d on FD %d\n",
183 + entry->mem_obj->recvTOS, fd );
184 + break;
185 + }
186 + p += o->cmsg_len;
187 + }
188 + } else {
189 + debug(11, 5) ("ZPH: getsockopt(IP_PKTOPTIONS) on FD %d: %s\n",
190 + fd, xstrerror());
191 + }
192 + } else {
193 + debug(11, 5) ("ZPH: setsockopt(IP_RECVTOS) on FD %d: %s\n",
194 + fd, xstrerror());
195 + }
196 + }
197 +/* ZPH patch ends here */
198 +#endif
199
200 debug(11, 5) ("httpSendRequest: FD %d: httpState %p.\n", fd, httpState);
201
202 diff -Nru squid-2.6.STABLE18.orig/src/structs.h squid-2.6.STABLE18/src/structs.h
203 --- squid-2.6.STABLE18.orig/src/structs.h 2007-09-06 00:28:34.000000000 +0300
204 +++ squid-2.6.STABLE18/src/structs.h 2008-01-10 22:33:03.000000000 +0200
205 @@ -669,6 +669,8 @@
206 int relaxed_header_parser;
207 int accel_no_pmtu_disc;
208 int global_internal_static;
209 + int zph_tos_parent;
210 + int zph_preserve_miss_tos;
211 int httpd_suppress_version_string;
212 int via;
213 int check_hostnames;
214 @@ -793,6 +795,9 @@
215 int sleep_after_fork; /* microseconds */
216 time_t minimum_expiry_time; /* seconds */
217 external_acl *externalAclHelperList;
218 + int zph_tos_local;
219 + int zph_tos_peer;
220 + int zph_preserve_miss_tos_mask;
221 errormap *errorMapList;
222 #if USE_SSL
223 struct {
224 @@ -1724,6 +1729,9 @@
225 const char *vary_encoding;
226 StoreEntry *ims_entry;
227 time_t refresh_timestamp;
228 +#if defined(_SQUID_LINUX_)
229 + unsigned char recvTOS; /* ZPH patch - stores remote server's TOS */
230 +#endif
231 };
232
233 struct _StoreEntry {
234
235
236
237 1.1 net-proxy/squid/files/squid-2.6.18-gentoo.patch
238
239 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.18-gentoo.patch?rev=1.1&view=markup
240 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.18-gentoo.patch?rev=1.1&content-type=text/plain
241
242 Index: squid-2.6.18-gentoo.patch
243 ===================================================================
244 diff -Nru squid-2.6.STABLE18.orig/helpers/basic_auth/MSNT/confload.c squid-2.6.STABLE18/helpers/basic_auth/MSNT/confload.c
245 --- squid-2.6.STABLE18.orig/helpers/basic_auth/MSNT/confload.c 2002-06-26 22:09:48.000000000 +0300
246 +++ squid-2.6.STABLE18/helpers/basic_auth/MSNT/confload.c 2008-01-10 22:28:29.000000000 +0200
247 @@ -24,7 +24,7 @@
248
249 /* Path to configuration file */
250 #ifndef SYSCONFDIR
251 -#define SYSCONFDIR "/usr/local/squid/etc"
252 +#define SYSCONFDIR "/etc/squid"
253 #endif
254 #define CONFIGFILE SYSCONFDIR "/msntauth.conf"
255
256 diff -Nru squid-2.6.STABLE18.orig/helpers/basic_auth/MSNT/msntauth.conf.default squid-2.6.STABLE18/helpers/basic_auth/MSNT/msntauth.conf.default
257 --- squid-2.6.STABLE18.orig/helpers/basic_auth/MSNT/msntauth.conf.default 2002-06-26 21:44:28.000000000 +0300
258 +++ squid-2.6.STABLE18/helpers/basic_auth/MSNT/msntauth.conf.default 2008-01-10 22:28:29.000000000 +0200
259 @@ -8,6 +8,6 @@
260 server other_PDC other_BDC otherdomain
261
262 # Denied and allowed users. Comment these if not needed.
263 -#denyusers /usr/local/squid/etc/msntauth.denyusers
264 -#allowusers /usr/local/squid/etc/msntauth.allowusers
265 +#denyusers /etc/squid/msntauth.denyusers
266 +#allowusers /etc/squid/msntauth.allowusers
267
268 diff -Nru squid-2.6.STABLE18.orig/helpers/basic_auth/SMB/Makefile.am squid-2.6.STABLE18/helpers/basic_auth/SMB/Makefile.am
269 --- squid-2.6.STABLE18.orig/helpers/basic_auth/SMB/Makefile.am 2005-05-17 19:56:26.000000000 +0300
270 +++ squid-2.6.STABLE18/helpers/basic_auth/SMB/Makefile.am 2008-01-10 22:28:29.000000000 +0200
271 @@ -14,7 +14,7 @@
272 ## FIXME: autoconf should test for the samba path.
273
274 SMB_AUTH_HELPER = smb_auth.sh
275 -SAMBAPREFIX=/usr/local/samba
276 +SAMBAPREFIX=/usr
277 SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
278
279 libexec_SCRIPTS = $(SMB_AUTH_HELPER)
280 diff -Nru squid-2.6.STABLE18.orig/helpers/basic_auth/SMB/smb_auth.sh squid-2.6.STABLE18/helpers/basic_auth/SMB/smb_auth.sh
281 --- squid-2.6.STABLE18.orig/helpers/basic_auth/SMB/smb_auth.sh 2001-01-08 01:36:46.000000000 +0200
282 +++ squid-2.6.STABLE18/helpers/basic_auth/SMB/smb_auth.sh 2008-01-10 22:28:29.000000000 +0200
283 @@ -24,7 +24,7 @@
284 read AUTHSHARE
285 read AUTHFILE
286 read SMBUSER
287 -read SMBPASS
288 +read -r SMBPASS
289
290 # Find domain controller
291 echo "Domain name: $DOMAINNAME"
292 @@ -47,7 +47,7 @@
293 addropt=""
294 fi
295 echo "Query address options: $addropt"
296 -dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'`
297 +dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+\..+ / { print $1 ; exit }'`
298 echo "Domain controller IP address: $dcip"
299 [ -n "$dcip" ] || exit 1
300
301 diff -Nru squid-2.6.STABLE18.orig/helpers/external_acl/session/squid_session.8 squid-2.6.STABLE18/helpers/external_acl/session/squid_session.8
302 --- squid-2.6.STABLE18.orig/helpers/external_acl/session/squid_session.8 2007-01-06 19:28:35.000000000 +0200
303 +++ squid-2.6.STABLE18/helpers/external_acl/session/squid_session.8 2008-01-10 22:28:29.000000000 +0200
304 @@ -35,7 +35,7 @@
305 .P
306 Configuration example using the default automatic mode
307 .IP
308 -external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %LOGIN /usr/local/squid/libexec/squid_session
309 +external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %LOGIN /usr/libexec/squid/squid_session
310 .IP
311 acl session external session
312 .IP
313 diff -Nru squid-2.6.STABLE18.orig/helpers/external_acl/unix_group/squid_unix_group.8 squid-2.6.STABLE18/helpers/external_acl/unix_group/squid_unix_group.8
314 --- squid-2.6.STABLE18.orig/helpers/external_acl/unix_group/squid_unix_group.8 2006-05-14 18:07:24.000000000 +0300
315 +++ squid-2.6.STABLE18/helpers/external_acl/unix_group/squid_unix_group.8 2008-01-10 22:28:29.000000000 +0200
316 @@ -27,7 +27,7 @@
317 This squid.conf example defines two Squid acls. usergroup1 matches users in group1, and usergroup2
318 matches users in group2 or group3
319 .IP
320 -external_acl_type unix_group %LOGIN /usr/local/squid/libexec/squid_unix_group -p
321 +external_acl_type unix_group %LOGIN /usr/libexec/squid/squid_unix_group -p
322 .IP
323 acl usergroup1 external unix_group group1
324 .IP
325 diff -Nru squid-2.6.STABLE18.orig/src/access_log.c squid-2.6.STABLE18/src/access_log.c
326 --- squid-2.6.STABLE18.orig/src/access_log.c 2007-06-03 03:40:32.000000000 +0300
327 +++ squid-2.6.STABLE18/src/access_log.c 2008-01-10 22:28:29.000000000 +0200
328 @@ -1225,7 +1225,7 @@
329 LogfileStatus = LOG_ENABLE;
330 }
331 #if HEADERS_LOG
332 - headerslog = logfileOpen("/usr/local/squid/logs/headers.log", MAX_URL << 1, 0);
333 + headerslog = logfileOpen("/var/log/squid/headers.log", MAX_URL << 1, 0);
334 assert(NULL != headerslog);
335 #endif
336 #if FORW_VIA_DB
337 diff -Nru squid-2.6.STABLE18.orig/src/cf.data.pre squid-2.6.STABLE18/src/cf.data.pre
338 --- squid-2.6.STABLE18.orig/src/cf.data.pre 2007-11-26 13:03:45.000000000 +0200
339 +++ squid-2.6.STABLE18/src/cf.data.pre 2008-01-10 22:28:29.000000000 +0200
340 @@ -640,6 +640,8 @@
341 acl Safe_ports port 488 # gss-http
342 acl Safe_ports port 591 # filemaker
343 acl Safe_ports port 777 # multiling http
344 +acl Safe_ports port 901 # SWAT
345 +acl purge method PURGE
346 acl CONNECT method CONNECT
347 NOCOMMENT_END
348 DOC_END
349 @@ -673,6 +675,9 @@
350 # Only allow cachemgr access from localhost
351 http_access allow manager localhost
352 http_access deny manager
353 +# Only allow purge requests from localhost
354 +http_access allow purge localhost
355 +http_access deny purge
356 # Deny requests to unknown ports
357 http_access deny !Safe_ports
358 # Deny CONNECT to other than SSL ports
359 @@ -691,6 +696,9 @@
360 #acl our_networks src 192.168.1.0/24 192.168.2.0/24
361 #http_access allow our_networks
362
363 +# Allow the localhost to have access by default
364 +http_access allow localhost
365 +
366 # And finally deny all other access to this proxy
367 http_access deny all
368 NOCOMMENT_END
369 @@ -3356,11 +3364,11 @@
370
371 NAME: cache_mgr
372 TYPE: string
373 -DEFAULT: webmaster
374 +DEFAULT: root
375 LOC: Config.adminEmail
376 DOC_START
377 Email-address of local cache manager who will receive
378 - mail if the cache dies. The default is "webmaster".
379 + mail if the cache dies. The default is "root".
380 DOC_END
381
382 NAME: mail_from
383 @@ -3389,12 +3397,12 @@
384
385 NAME: cache_effective_user
386 TYPE: string
387 -DEFAULT: nobody
388 +DEFAULT: squid
389 LOC: Config.effectiveUser
390 DOC_START
391 If you start Squid as root, it will change its effective/real
392 UID/GID to the user specified below. The default is to change
393 - to UID to nobody. If you define cache_effective_user, but not
394 + to UID to squid. If you define cache_effective_user, but not
395 cache_effective_group, Squid sets the GID to the effective
396 user's default group ID (taken from the password file) and
397 supplementary group list from the from groups membership of
398 @@ -4031,12 +4039,12 @@
399 NAME: snmp_port
400 TYPE: ushort
401 LOC: Config.Port.snmp
402 -DEFAULT: 3401
403 +DEFAULT: 0
404 IFDEF: SQUID_SNMP
405 DOC_START
406 Squid can now serve statistics and status information via SNMP.
407 - By default it listens to port 3401 on the machine. If you don't
408 - wish to use SNMP, set this to "0".
409 + By default snmp_port is disabled. If you wish to use SNMP,
410 + set this to "3401" (or any other number you like).
411 DOC_END
412
413 NAME: snmp_access
414 @@ -4107,12 +4115,12 @@
415 NAME: htcp_port
416 IFDEF: USE_HTCP
417 TYPE: ushort
418 -DEFAULT: 4827
419 +DEFAULT: 0
420 LOC: Config.Port.htcp
421 DOC_START
422 The port number where Squid sends and receives HTCP queries to
423 - and from neighbor caches. Default is 4827. To disable use
424 - "0".
425 + and from neighbor caches. To turn it on you want to set it to
426 + 4827. By default it is set to "0" (disabled).
427 DOC_END
428
429 NAME: log_icp_queries
430 @@ -4964,6 +4972,9 @@
431 If you disable this, it will appear as
432
433 X-Forwarded-For: unknown
434 +NOCOMMENT_START
435 +forwarded_for off
436 +NOCOMMENT_END
437 DOC_END
438
439 NAME: cachemgr_passwd
440 diff -Nru squid-2.6.STABLE18.orig/src/client_side.c squid-2.6.STABLE18/src/client_side.c
441 --- squid-2.6.STABLE18.orig/src/client_side.c 2007-09-03 16:13:36.000000000 +0300
442 +++ squid-2.6.STABLE18/src/client_side.c 2008-01-10 22:28:29.000000000 +0200
443 @@ -4597,14 +4597,7 @@
444 debug(83, 2) ("clientNegotiateSSL: Session %p reused on FD %d (%s:%d)\n", SSL_get_session(ssl), fd, fd_table[fd].ipaddr, (int) fd_table[fd].remote_port);
445 } else {
446 if (do_debug(83, 4)) {
447 - /* Write out the SSL session details.. actually the call below, but
448 - * OpenSSL headers do strange typecasts confusing GCC.. */
449 - /* PEM_write_SSL_SESSION(debug_log, SSL_get_session(ssl)); */
450 -#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x00908000L
451 - PEM_ASN1_write((i2d_of_void *) i2d_SSL_SESSION, PEM_STRING_SSL_SESSION, debug_log, (char *) SSL_get_session(ssl), NULL, NULL, 0, NULL, NULL);
452 -#else
453 PEM_ASN1_write(i2d_SSL_SESSION, PEM_STRING_SSL_SESSION, debug_log, (char *) SSL_get_session(ssl), NULL, NULL, 0, NULL, NULL);
454 -#endif
455 /* Note: This does not automatically fflush the log file.. */
456 }
457 debug(83, 2) ("clientNegotiateSSL: New session %p on FD %d (%s:%d)\n", SSL_get_session(ssl), fd, fd_table[fd].ipaddr, (int) fd_table[fd].remote_port);
458 diff -Nru squid-2.6.STABLE18.orig/src/defines.h squid-2.6.STABLE18/src/defines.h
459 --- squid-2.6.STABLE18.orig/src/defines.h 2007-02-04 00:58:20.000000000 +0200
460 +++ squid-2.6.STABLE18/src/defines.h 2008-01-10 22:28:29.000000000 +0200
461 @@ -259,7 +259,7 @@
462
463 /* were to look for errors if config path fails */
464 #ifndef DEFAULT_SQUID_ERROR_DIR
465 -#define DEFAULT_SQUID_ERROR_DIR "/usr/local/squid/etc/errors"
466 +#define DEFAULT_SQUID_ERROR_DIR "/usr/share/squid/errors/English"
467 #endif
468
469 /* gb_type operations */
470 diff -Nru squid-2.6.STABLE18.orig/src/main.c squid-2.6.STABLE18/src/main.c
471 --- squid-2.6.STABLE18.orig/src/main.c 2007-11-26 12:47:23.000000000 +0200
472 +++ squid-2.6.STABLE18/src/main.c 2008-01-10 22:28:29.000000000 +0200
473 @@ -372,6 +372,22 @@
474 asnFreeMemory();
475 }
476
477 +#if USE_UNLINKD
478 +static int
479 +needUnlinkd(void)
480 +{
481 + int i;
482 + int r = 0;
483 + for (i = 0; i < Config.cacheSwap.n_configured; i++) {
484 + if (strcmp(Config.cacheSwap.swapDirs[i].type, "ufs") == 0 ||
485 + strcmp(Config.cacheSwap.swapDirs[i].type, "aufs") == 0 ||
486 + strcmp(Config.cacheSwap.swapDirs[i].type, "diskd") == 0)
487 + r++;
488 + }
489 + return r;
490 +}
491 +#endif
492 +
493 static void
494 mainReconfigure(void)
495 {
496 @@ -395,6 +411,7 @@
497 locationRewriteShutdown();
498 authenticateShutdown();
499 externalAclShutdown();
500 + unlinkdClose();
501 storeDirCloseSwapLogs();
502 storeLogClose();
503 accessLogClose();
504 @@ -430,6 +447,9 @@
505 #if USE_WCCPv2
506 wccp2Init();
507 #endif
508 +#if USE_UNLINKD
509 + if (needUnlinkd()) unlinkdInit();
510 +#endif
511 serverConnectionsOpen();
512 neighbors_init();
513 storeDirOpenSwapLogs();
514 @@ -593,7 +613,7 @@
515
516 if (!configured_once) {
517 #if USE_UNLINKD
518 - unlinkdInit();
519 + if (needUnlinkd()) unlinkdInit();
520 #endif
521 urlInitialize();
522 cachemgrInit();
523 diff -Nru squid-2.6.STABLE18.orig/src/Makefile.am squid-2.6.STABLE18/src/Makefile.am
524 --- squid-2.6.STABLE18.orig/src/Makefile.am 2007-09-06 00:50:15.000000000 +0300
525 +++ squid-2.6.STABLE18/src/Makefile.am 2008-01-10 22:28:29.000000000 +0200
526 @@ -325,12 +325,12 @@
527 DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf
528 DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf
529 DEFAULT_DNSSERVER = $(libexecdir)/`echo dnsserver | sed '$(transform);s/$$/$(EXEEXT)/'`
530 -DEFAULT_LOG_PREFIX = $(localstatedir)/logs
531 +DEFAULT_LOG_PREFIX = $(localstatedir)/log/squid
532 DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log
533 DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log
534 DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log
535 -DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid
536 -DEFAULT_SWAP_DIR = $(localstatedir)/cache
537 +DEFAULT_PID_FILE = $(localstatedir)/run/squid.pid
538 +DEFAULT_SWAP_DIR = $(localstatedir)/cache/squid
539 DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
540 DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'`
541 DEFAULT_DISKD = $(libexecdir)/`echo diskd-daemon | sed '$(transform);s/$$/$(EXEEXT)/'`
542
543
544
545 1.1 net-proxy/squid/files/squid-2.6.18-qos.patch
546
547 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.18-qos.patch?rev=1.1&view=markup
548 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/squid-2.6.18-qos.patch?rev=1.1&content-type=text/plain
549
550 Index: squid-2.6.18-qos.patch
551 ===================================================================
552 diff -Nru squid-2.6.STABLE18.orig/src/cache_cf.c squid-2.6.STABLE18/src/cache_cf.c
553 --- squid-2.6.STABLE18.orig/src/cache_cf.c 2007-08-31 16:49:54.000000000 +0300
554 +++ squid-2.6.STABLE18/src/cache_cf.c 2008-01-10 22:33:54.000000000 +0200
555 @@ -891,6 +891,65 @@
556 }
557 }
558
559 +CBDATA_TYPE(acl_priority);
560 +
561 +static void
562 +dump_acl_priority(StoreEntry * entry, const char *name, acl_priority * head)
563 +{
564 + acl_priority *l;
565 + for (l = head; l; l = l->next) {
566 + if (l->priority > 0)
567 + storeAppendPrintf(entry, "%s %04X:%04X", name,
568 + l->priority >> 16, l->priority & 0xFFFF);
569 + else
570 + storeAppendPrintf(entry, "%s none", name);
571 + dump_acl_list(entry, l->acl_list);
572 + storeAppendPrintf(entry, "\n");
573 + }
574 +}
575 +
576 +static void
577 +freed_acl_priority(void *data)
578 +{
579 + acl_priority *l = data;
580 + aclDestroyAclList(&l->acl_list);
581 +}
582 +
583 +static void
584 +parse_acl_priority(acl_priority ** head)
585 +{
586 + acl_priority *l;
587 + acl_priority **tail = head; /* sane name below */
588 + unsigned long priority, t1, t2;
589 + char junk;
590 + char *token = strtok(NULL, w_space);
591 + if (!token)
592 + self_destruct();
593 + if (sscanf(token, "%x:%x%c", &t1, &t2, &junk) != 2)
594 + self_destruct();
595 + if (t1 < 0 || t1 > 0xFFFF || t2 < 0 || t2 > 0xFFFF)
596 + self_destruct();
597 + priority = t1 << 16 | t2;
598 + CBDATA_INIT_TYPE_FREECB(acl_priority, freed_acl_priority);
599 + l = cbdataAlloc(acl_priority);
600 + l->priority = priority;
601 + aclParseAclList(&l->acl_list);
602 + while (*tail)
603 + tail = &(*tail)->next;
604 + *tail = l;
605 +}
606 +
607 +static void
608 +free_acl_priority(acl_priority ** head)
609 +{
610 + while (*head) {
611 + acl_priority *l = *head;
612 + *head = l->next;
613 + l->next = NULL;
614 + cbdataFree(l);
615 + }
616 +}
617 +
618 #if DELAY_POOLS
619
620 /* do nothing - free_delay_pool_count is the magic free function.
621 diff -Nru squid-2.6.STABLE18.orig/src/cf.data.depend squid-2.6.STABLE18/src/cf.data.depend
622 --- squid-2.6.STABLE18.orig/src/cf.data.depend 2007-09-06 00:50:15.000000000 +0300
623 +++ squid-2.6.STABLE18/src/cf.data.depend 2008-01-10 22:33:54.000000000 +0200
624 @@ -5,6 +5,7 @@
625 acl_address acl
626 acl_b_size_t acl
627 acl_tos acl
628 +acl_priority acl
629 address
630 authparam
631 b_int64_t
632 diff -Nru squid-2.6.STABLE18.orig/src/cf.data.pre squid-2.6.STABLE18/src/cf.data.pre
633 --- squid-2.6.STABLE18.orig/src/cf.data.pre 2008-01-10 22:33:35.000000000 +0200
634 +++ squid-2.6.STABLE18/src/cf.data.pre 2008-01-10 22:33:54.000000000 +0200
635 @@ -1239,6 +1239,27 @@
636 Default: 255 (TOS from server is not changed).
637 DOC_END
638
639 +NAME: tcp_outgoing_priority
640 +TYPE: acl_priority
641 +DEFAULT: none
642 +LOC: Config.accessList.outgoing_priority
643 +DOC_START
644 + Allows you to select the priority of the outgoing connection,
645 + based on the username or source address making the request. The
646 + priority can be used by Linux QoS Qdiscs for classification.
647 +
648 + tcp_outgoing_priority priority [!]aclname ...
649 +
650 + Example where requests from special_service_net are assigned
651 + priority 10:100
652 +
653 + acl special_service_net src 10.0.0.0/255.255.255.0
654 + tcp_outgoing_priority 10:100 special_service_net
655 +
656 + Processing proceeds in the order specified, and stops at first fully
657 + matching line.
658 +DOC_END
659 +
660 NAME: tcp_outgoing_address
661 TYPE: acl_address
662 DEFAULT: none
663 diff -Nru squid-2.6.STABLE18.orig/src/comm.c squid-2.6.STABLE18/src/comm.c
664 --- squid-2.6.STABLE18.orig/src/comm.c 2007-04-17 12:39:56.000000000 +0300
665 +++ squid-2.6.STABLE18/src/comm.c 2008-01-10 22:33:54.000000000 +0200
666 @@ -162,7 +162,7 @@
667 int flags,
668 const char *note)
669 {
670 - return comm_openex(sock_type, proto, addr, port, flags, 0, note);
671 + return comm_openex(sock_type, proto, addr, port, flags, 0, 0, note);
672 }
673
674
675 @@ -175,10 +175,12 @@
676 u_short port,
677 int flags,
678 unsigned char TOS,
679 + unsigned long PRIORITY,
680 const char *note)
681 {
682 int new_socket;
683 int tos = 0;
684 + unsigned long priority = 0;
685 fde *F = NULL;
686
687 /* Create socket for accepting new connections. */
688 @@ -209,12 +211,25 @@
689 debug(5, 0) ("comm_open: setsockopt(IP_TOS) not supported on this platform\n");
690 #endif
691 }
692 + if (PRIORITY) {
693 +#ifdef SO_PRIORITY
694 + priority = PRIORITY;
695 + enter_suid();
696 + if (setsockopt(new_socket, SOL_SOCKET, SO_PRIORITY, (char *) &priority, sizeof(unsigned long)) < 0)
697 + debug(50, 1) ("comm_open: setsockopt(SO_PRIORITY) on FD %d: %s\n",
698 + new_socket, xstrerror());
699 + leave_suid();
700 +#else
701 + debug(50, 0) ("comm_open: setsockopt(SO_PRIORITY) not supported on this platform\n");
702 +#endif
703 + }
704 /* update fdstat */
705 debug(5, 5) ("comm_open: FD %d is a new socket\n", new_socket);
706 fd_open(new_socket, FD_SOCKET, note);
707 F = &fd_table[new_socket];
708 F->local_addr = addr;
709 F->tos = tos;
710 + F->priority = priority;
711 if (!(flags & COMM_NOCLOEXEC))
712 commSetCloseOnExec(new_socket);
713 if ((flags & COMM_REUSEADDR))
714 @@ -382,6 +397,15 @@
715 debug(5, 1) ("commResetFD: setsockopt(IP_TOS) on FD %d: %s\n", cs->fd, xstrerror());
716 }
717 #endif
718 +#ifdef SO_PRIORITY
719 + if (F->priority) {
720 + unsigned long priority = F->priority;
721 + enter_suid();
722 + if (setsockopt(cs->fd, SOL_SOCKET, SO_PRIORITY, (char *)&priority, sizeof(unsigned long)) < 0)
723 + debug(50, 1) ("commResetFD: setsockopt(SO_PRIORITY) on FD %d: %s\n", cs->fd, xstrerror());
724 + leave_suid();
725 + }
726 +#endif
727 if (F->flags.close_on_exec)
728 commSetCloseOnExec(cs->fd);
729 if (F->flags.nonblocking)
730 diff -Nru squid-2.6.STABLE18.orig/src/forward.c squid-2.6.STABLE18/src/forward.c
731 --- squid-2.6.STABLE18.orig/src/forward.c 2007-09-06 00:28:34.000000000 +0300
732 +++ squid-2.6.STABLE18/src/forward.c 2008-01-10 22:33:54.000000000 +0200
733 @@ -418,6 +418,17 @@
734 return 0;
735 }
736
737 +static unsigned long
738 +aclMapPriority(acl_priority * head, aclCheck_t * ch)
739 +{
740 + acl_priority *l;
741 + for (l = head; l; l = l->next) {
742 + if (aclMatchAclList(l->acl_list, ch))
743 + return l->priority;
744 + }
745 + return 0;
746 +}
747 +
748 struct in_addr
749 getOutgoingAddr(request_t * request)
750 {
751 @@ -446,6 +457,20 @@
752 return aclMapTOS(Config.accessList.outgoing_tos, &ch);
753 }
754
755 +unsigned long
756 +getOutgoingPriority(request_t * request)
757 +{
758 + aclCheck_t ch;
759 + memset(&ch, '\0', sizeof(aclCheck_t));
760 + if (request) {
761 + ch.src_addr = request->client_addr;
762 + ch.my_addr = request->my_addr;
763 + ch.my_port = request->my_port;
764 + ch.request = request;
765 + }
766 + return aclMapPriority(Config.accessList.outgoing_priority, &ch);
767 +}
768 +
769 static void
770 fwdConnectStart(void *data)
771 {
772 @@ -462,6 +487,7 @@
773 int ftimeout = Config.Timeout.forward - (squid_curtime - fwdState->start);
774 struct in_addr outgoing;
775 unsigned short tos;
776 + unsigned long priority;
777 #if LINUX_TPROXY
778 struct in_tproxy itp;
779 #endif
780 @@ -547,15 +573,17 @@
781 #endif
782 outgoing = getOutgoingAddr(fwdState->request);
783 tos = getOutgoingTOS(fwdState->request);
784 + priority = getOutgoingPriority(fwdState->request);
785
786 - debug(17, 3) ("fwdConnectStart: got addr %s, tos %d\n",
787 - inet_ntoa(outgoing), tos);
788 + debug(17, 3) ("fwdConnectStart: got addr %s, tos %d, priority %lu\n",
789 + inet_ntoa(outgoing), tos, priority);
790 fd = comm_openex(SOCK_STREAM,
791 IPPROTO_TCP,
792 outgoing,
793 0,
794 COMM_NONBLOCKING,
795 tos,
796 + priority,
797 url);
798 if (fd < 0) {
799 debug(50, 4) ("fwdConnectStart: %s\n", xstrerror());
800 diff -Nru squid-2.6.STABLE18.orig/src/protos.h squid-2.6.STABLE18/src/protos.h
801 --- squid-2.6.STABLE18.orig/src/protos.h 2007-07-15 12:52:17.000000000 +0300
802 +++ squid-2.6.STABLE18/src/protos.h 2008-01-10 22:33:54.000000000 +0200
803 @@ -160,7 +160,7 @@
804 extern void comm_init(void);
805 extern int comm_listen(int sock);
806 extern int comm_open(int, int, struct in_addr, u_short port, int, const char *note);
807 -extern int comm_openex(int, int, struct in_addr, u_short, int, unsigned char TOS, const char *);
808 +extern int comm_openex(int, int, struct in_addr, u_short, int, unsigned char TOS, unsigned long PRIORITY, const char *);
809 extern u_short comm_local_port(int fd);
810
811 extern void commDeferFD(int fd);
812 @@ -735,6 +735,7 @@
813 #endif
814 struct in_addr getOutgoingAddr(request_t * request);
815 unsigned long getOutgoingTOS(request_t * request);
816 +unsigned long getOutgoingPriority(request_t * request);
817
818 extern void urnStart(request_t *, StoreEntry *);
819
820 diff -Nru squid-2.6.STABLE18.orig/src/ssl.c squid-2.6.STABLE18/src/ssl.c
821 --- squid-2.6.STABLE18.orig/src/ssl.c 2007-02-03 23:53:38.000000000 +0200
822 +++ squid-2.6.STABLE18/src/ssl.c 2008-01-10 22:33:54.000000000 +0200
823 @@ -524,6 +524,7 @@
824 0,
825 COMM_NONBLOCKING,
826 getOutgoingTOS(request),
827 ++ getOutgoingPriority(request),
828 url);
829 if (sock == COMM_ERROR) {
830 debug(26, 4) ("sslStart: Failed because we're out of sockets.\n");
831 diff -Nru squid-2.6.STABLE18.orig/src/structs.h squid-2.6.STABLE18/src/structs.h
832 --- squid-2.6.STABLE18.orig/src/structs.h 2008-01-10 22:33:35.000000000 +0200
833 +++ squid-2.6.STABLE18/src/structs.h 2008-01-10 22:33:54.000000000 +0200
834 @@ -296,6 +296,12 @@
835 int tos;
836 };
837
838 +struct _acl_priority {
839 + acl_priority *next;
840 + acl_list *acl_list;
841 + unsigned long priority;
842 +};
843 +
844 struct _aclCheck_t {
845 const acl_access *access_list;
846 struct in_addr src_addr;
847 @@ -705,6 +711,7 @@
848 acl_access *reply;
849 acl_address *outgoing_address;
850 acl_tos *outgoing_tos;
851 + acl_priority *outgoing_priority;
852 #if USE_HTCP
853 acl_access *htcp;
854 acl_access *htcp_clr;
855 @@ -876,6 +883,7 @@
856 u_short remote_port;
857 struct in_addr local_addr;
858 unsigned char tos;
859 + unsigned long priority;
860 char ipaddr[16]; /* dotted decimal address of peer */
861 char desc[FD_DESC_SZ];
862 struct {
863 diff -Nru squid-2.6.STABLE18.orig/src/typedefs.h squid-2.6.STABLE18/src/typedefs.h
864 --- squid-2.6.STABLE18.orig/src/typedefs.h 2006-09-02 17:08:42.000000000 +0300
865 +++ squid-2.6.STABLE18/src/typedefs.h 2008-01-10 22:33:54.000000000 +0200
866 @@ -102,6 +102,7 @@
867 typedef struct _acl_access acl_access;
868 typedef struct _acl_address acl_address;
869 typedef struct _acl_tos acl_tos;
870 +typedef struct _acl_priority acl_priority;
871 typedef struct _aclCheck_t aclCheck_t;
872 typedef struct _wordlist wordlist;
873 typedef struct _intlist intlist;
874
875
876
877 1.1 net-proxy/squid/files/digest-squid-2.6.18
878
879 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/digest-squid-2.6.18?rev=1.1&view=markup
880 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-proxy/squid/files/digest-squid-2.6.18?rev=1.1&content-type=text/plain
881
882 Index: digest-squid-2.6.18
883 ===================================================================
884 MD5 d7ff75f7b75ba7bc28ea453fe4b94434 squid-2.6.STABLE18.tar.gz 1725660
885 RMD160 62542c607b2ab3630ce82879b17509b412029479 squid-2.6.STABLE18.tar.gz 1725660
886 SHA256 51a85f2dae50a793a1ed38191676cbf9ab2ecdc059304fbf6de041d36692d634 squid-2.6.STABLE18.tar.gz 1725660
887
888
889
890 --
891 gentoo-commits@l.g.o mailing list