--------------------- PatchSet 6334 Date: 2004/10/19 14:18:05 Author: oliv3 Branch: icap-2_5 Tag: (none) Log: Applied patch from Graeme Members: src/HttpReply.c:1.10.52.3->1.10.52.4 src/HttpRequest.c:1.7.72.2->1.7.72.3 src/MemBuf.c:1.5.44.6->1.5.44.7 src/cache_cf.c:1.38.6.11.2.11->1.38.6.11.2.12 src/carp.c:1.5.88.3->1.5.88.4 src/cf.data.pre:1.49.2.33.2.20->1.49.2.33.2.21 src/client_db.c:1.6.88.3->1.6.88.4 src/client_side.c:1.47.2.28.2.23->1.47.2.28.2.24 src/enums.h:1.29.2.8.2.9->1.29.2.8.2.10 src/forward.c:1.13.6.3.2.7->1.13.6.3.2.8 src/ftp.c:1.18.6.7.2.6->1.18.6.7.2.7 src/http.c:1.17.6.3.6.26->1.17.6.3.6.27 src/icap_common.c:1.1.2.31->1.1.2.32 src/icap_reqmod.c:1.1.2.33->1.1.2.34 src/icap_respmod.c:1.1.2.43->1.1.2.44 src/protos.h:1.41.6.13.2.27->1.41.6.13.2.28 src/structs.h:1.48.2.9.2.32->1.48.2.9.2.33 src/typedefs.h:1.25.6.1.6.9->1.25.6.1.6.10 Index: squid/src/HttpReply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpReply.c,v retrieving revision 1.10.52.3 retrieving revision 1.10.52.4 diff -u -r1.10.52.3 -r1.10.52.4 --- squid/src/HttpReply.c 19 Oct 2004 08:51:13 -0000 1.10.52.3 +++ squid/src/HttpReply.c 19 Oct 2004 14:18:05 -0000 1.10.52.4 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.c,v 1.10.52.3 2004/10/19 08:51:13 oliv3 Exp $ + * $Id: HttpReply.c,v 1.10.52.4 2004/10/19 14:18:05 oliv3 Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov Index: squid/src/HttpRequest.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpRequest.c,v retrieving revision 1.7.72.2 retrieving revision 1.7.72.3 diff -u -r1.7.72.2 -r1.7.72.3 --- squid/src/HttpRequest.c 19 Oct 2004 08:51:13 -0000 1.7.72.2 +++ squid/src/HttpRequest.c 19 Oct 2004 14:18:06 -0000 1.7.72.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.c,v 1.7.72.2 2004/10/19 08:51:13 oliv3 Exp $ + * $Id: HttpRequest.c,v 1.7.72.3 2004/10/19 14:18:06 oliv3 Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels Index: squid/src/MemBuf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/MemBuf.c,v retrieving revision 1.5.44.6 retrieving revision 1.5.44.7 diff -u -r1.5.44.6 -r1.5.44.7 --- squid/src/MemBuf.c 19 Oct 2004 08:51:13 -0000 1.5.44.6 +++ squid/src/MemBuf.c 19 Oct 2004 14:18:06 -0000 1.5.44.7 @@ -1,6 +1,6 @@ /* - * $Id: MemBuf.c,v 1.5.44.6 2004/10/19 08:51:13 oliv3 Exp $ + * $Id: MemBuf.c,v 1.5.44.7 2004/10/19 14:18:06 oliv3 Exp $ * * DEBUG: section 59 auto-growing Memory Buffer with printf * AUTHOR: Alex Rousskov @@ -158,7 +158,7 @@ (*mb->freefunc) (mb->buf); /* free */ mb->freefunc = NULL; /* freeze */ mb->buf = NULL; - mb->size = mb->capacity = 0; + mb->size = mb->capacity = mb->max_capacity = 0; } /* cleans the buffer without changing its capacity Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.38.6.11.2.11 retrieving revision 1.38.6.11.2.12 diff -u -r1.38.6.11.2.11 -r1.38.6.11.2.12 --- squid/src/cache_cf.c 29 Sep 2004 12:09:52 -0000 1.38.6.11.2.11 +++ squid/src/cache_cf.c 19 Oct 2004 14:18:07 -0000 1.38.6.11.2.12 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.38.6.11.2.11 2004/09/29 12:09:52 hno Exp $ + * $Id: cache_cf.c,v 1.38.6.11.2.12 2004/10/19 14:18:07 oliv3 Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2216,10 +2216,10 @@ static int icap_service_process(icap_service * s) { - char *start, *end; + char *start, *end, *tempEnd; char *tailp; unsigned int len; - int port_in_uri; + int port_in_uri, resource_in_uri=0; s->type = icapServiceToType(s->type_name); if (s->type >= ICAP_SERVICE_MAX) { debug(3, 0) ("icap_service_process (line %d): wrong service type %s\n", config_lineno, s->type_name); @@ -2245,34 +2245,49 @@ /* ok */ port_in_uri = 1; debug(3, 5) ("icap_service_process (line %d): port given\n", config_lineno); - } else if ((end = strchr(start, '/')) != NULL) { + } else { /* ok */ port_in_uri = 0; debug(3, 5) ("icap_service_process (line %d): no port given\n", config_lineno); + } + + if ((tempEnd = strchr(start, '/')) != NULL) { + /* ok */ + resource_in_uri = 1; + debug(3, 5) ("icap_service_process (line %d): resource given\n", config_lineno); + if (end == '\0') { + end = tempEnd; + } } else { - debug(3, 0) ("icap_service_process (line %d): wrong service uri: %s\n", config_lineno, s->uri); - return 0; + /* ok */ + resource_in_uri = 0; + debug(3, 5) ("icap_service_process (line %d): no resource given\n", config_lineno); } + + tempEnd = strchr(start, '\0'); + if (end == '\0') { + end = tempEnd; + } + len = end - start; s->hostname = xstrndup(start, len + 1); s->hostname[len] = 0; + debug(3, 5) ("icap_service_process (line %d): hostname=%s\n", config_lineno, s->hostname); start = end; if (port_in_uri) { start++; /* skip ':' */ - if ((end = strchr(start, '/')) != NULL) { - s->port = strtoul(start, &tailp, 0) % 65536; - if (tailp != end) { - debug(3, 0) ("icap_service_process (line %d): wrong service uri (port could not be parsed): %s\n", config_lineno, s->uri); - return 0; - } - debug(3, 5) ("icap_service_process (line %d): port=%d\n", config_lineno, s->port); - start = end; - if (start[0] != '/') { - debug(3, 0) ("icap_service_process (line %d): no '/' between port and resource found in %s\n", config_lineno, s->uri); - return 0; - } + if (resource_in_uri) + end = strchr(start, '/'); + else + end = strchr(start, '\0'); + s->port = strtoul(start, &tailp, 0) % 65536; + if (tailp != end) { + debug(3, 0) ("icap_service_process (line %d): wrong service uri (port could not be parsed): %s\n", config_lineno, s->uri); + return 0; } + debug(3, 5) ("icap_service_process (line %d): port=%d\n", config_lineno, s->port); + start = end; } else { /* no explicit ICAP port; first ask by getservbyname or default to * hardwired port 1344 per ICAP specification section 4.2 */ @@ -2286,15 +2301,19 @@ } } - start++; /* skip '/' */ - /* the rest is resource name */ - end = strchr(start, '\0'); - len = end - start; - if (len > 1024) { - debug(3, 0) ("icap_service_process (line %d): long resource name (>1024), probably wrong\n", config_lineno); + if (resource_in_uri) { + start++; /* skip '/' */ + /* the rest is resource name */ + end = strchr(start, '\0'); + len = end - start; + if (len > 1024) { + debug(3, 0) ("icap_service_process (line %d): long resource name (>1024), probably wrong\n", config_lineno); + } + s->resource = xstrndup(start, len + 1); + s->resource[len] = 0; + debug(3, 5) ("icap_service_process (line %d): service=%s\n", config_lineno, s->resource); } - s->resource = xstrndup(start, len + 1); - s->resource[len] = 0; + /* check bypass */ if ((s->bypass != 0) && (s->bypass != 1)) { debug(3, 0) ("icap_service_process (line %d): invalid bypass value\n", config_lineno); Index: squid/src/carp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/carp.c,v retrieving revision 1.5.88.3 retrieving revision 1.5.88.4 diff -u -r1.5.88.3 -r1.5.88.4 --- squid/src/carp.c 19 Oct 2004 08:51:14 -0000 1.5.88.3 +++ squid/src/carp.c 19 Oct 2004 14:18:08 -0000 1.5.88.4 @@ -1,6 +1,6 @@ /* - * $Id: carp.c,v 1.5.88.3 2004/10/19 08:51:14 oliv3 Exp $ + * $Id: carp.c,v 1.5.88.4 2004/10/19 14:18:08 oliv3 Exp $ * * DEBUG: section 39 Cache Array Routing Protocol * AUTHOR: Eric Stern Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.49.2.33.2.20 retrieving revision 1.49.2.33.2.21 diff -u -r1.49.2.33.2.20 -r1.49.2.33.2.21 --- squid/src/cf.data.pre 19 Oct 2004 08:51:15 -0000 1.49.2.33.2.20 +++ squid/src/cf.data.pre 19 Oct 2004 14:18:09 -0000 1.49.2.33.2.21 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.49.2.33.2.20 2004/10/19 08:51:15 oliv3 Exp $ +# $Id: cf.data.pre,v 1.49.2.33.2.21 2004/10/19 14:18:09 oliv3 Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ Index: squid/src/client_db.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_db.c,v retrieving revision 1.6.88.3 retrieving revision 1.6.88.4 diff -u -r1.6.88.3 -r1.6.88.4 --- squid/src/client_db.c 19 Oct 2004 08:51:17 -0000 1.6.88.3 +++ squid/src/client_db.c 19 Oct 2004 14:18:11 -0000 1.6.88.4 @@ -1,6 +1,6 @@ /* - * $Id: client_db.c,v 1.6.88.3 2004/10/19 08:51:17 oliv3 Exp $ + * $Id: client_db.c,v 1.6.88.4 2004/10/19 14:18:11 oliv3 Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.28.2.23 retrieving revision 1.47.2.28.2.24 diff -u -r1.47.2.28.2.23 -r1.47.2.28.2.24 --- squid/src/client_side.c 19 Oct 2004 08:51:17 -0000 1.47.2.28.2.23 +++ squid/src/client_side.c 19 Oct 2004 14:18:11 -0000 1.47.2.28.2.24 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.28.2.23 2004/10/19 08:51:17 oliv3 Exp $ + * $Id: client_side.c,v 1.47.2.28.2.24 2004/10/19 14:18:11 oliv3 Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels Index: squid/src/enums.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/enums.h,v retrieving revision 1.29.2.8.2.9 retrieving revision 1.29.2.8.2.10 diff -u -r1.29.2.8.2.9 -r1.29.2.8.2.10 --- squid/src/enums.h 19 Oct 2004 08:51:20 -0000 1.29.2.8.2.9 +++ squid/src/enums.h 19 Oct 2004 14:18:15 -0000 1.29.2.8.2.10 @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.29.2.8.2.9 2004/10/19 08:51:20 oliv3 Exp $ + * $Id: enums.h,v 1.29.2.8.2.10 2004/10/19 14:18:15 oliv3 Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.13.6.3.2.7 retrieving revision 1.13.6.3.2.8 diff -u -r1.13.6.3.2.7 -r1.13.6.3.2.8 --- squid/src/forward.c 19 Oct 2004 08:51:20 -0000 1.13.6.3.2.7 +++ squid/src/forward.c 19 Oct 2004 14:18:15 -0000 1.13.6.3.2.8 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.13.6.3.2.7 2004/10/19 08:51:20 oliv3 Exp $ + * $Id: forward.c,v 1.13.6.3.2.8 2004/10/19 14:18:15 oliv3 Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v retrieving revision 1.18.6.7.2.6 retrieving revision 1.18.6.7.2.7 diff -u -r1.18.6.7.2.6 -r1.18.6.7.2.7 --- squid/src/ftp.c 19 Oct 2004 08:51:21 -0000 1.18.6.7.2.6 +++ squid/src/ftp.c 19 Oct 2004 14:18:15 -0000 1.18.6.7.2.7 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.18.6.7.2.6 2004/10/19 08:51:21 oliv3 Exp $ + * $Id: ftp.c,v 1.18.6.7.2.7 2004/10/19 14:18:15 oliv3 Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.17.6.3.6.26 retrieving revision 1.17.6.3.6.27 diff -u -r1.17.6.3.6.26 -r1.17.6.3.6.27 --- squid/src/http.c 19 Oct 2004 08:51:22 -0000 1.17.6.3.6.26 +++ squid/src/http.c 19 Oct 2004 14:18:17 -0000 1.17.6.3.6.27 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.17.6.3.6.26 2004/10/19 08:51:22 oliv3 Exp $ + * $Id: http.c,v 1.17.6.3.6.27 2004/10/19 14:18:17 oliv3 Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived Index: squid/src/icap_common.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_common.c,v retrieving revision 1.1.2.31 retrieving revision 1.1.2.32 diff -u -r1.1.2.31 -r1.1.2.32 --- squid/src/icap_common.c 19 Oct 2004 08:51:22 -0000 1.1.2.31 +++ squid/src/icap_common.c 19 Oct 2004 14:18:17 -0000 1.1.2.32 @@ -1,5 +1,5 @@ /* - * $Id: icap_common.c,v 1.1.2.31 2004/10/19 08:51:22 oliv3 Exp $ + * $Id: icap_common.c,v 1.1.2.32 2004/10/19 14:18:17 oliv3 Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.c,v retrieving revision 1.1.2.33 retrieving revision 1.1.2.34 diff -u -r1.1.2.33 -r1.1.2.34 --- squid/src/icap_reqmod.c 19 Oct 2004 08:51:22 -0000 1.1.2.33 +++ squid/src/icap_reqmod.c 19 Oct 2004 14:18:17 -0000 1.1.2.34 @@ -1,6 +1,6 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.33 2004/10/19 08:51:22 oliv3 Exp $ + * $Id: icap_reqmod.c,v 1.1.2.34 2004/10/19 14:18:17 oliv3 Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company Index: squid/src/icap_respmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_respmod.c,v retrieving revision 1.1.2.43 retrieving revision 1.1.2.44 diff -u -r1.1.2.43 -r1.1.2.44 --- squid/src/icap_respmod.c 19 Oct 2004 08:51:23 -0000 1.1.2.43 +++ squid/src/icap_respmod.c 19 Oct 2004 14:18:18 -0000 1.1.2.44 @@ -1,6 +1,6 @@ /* - * $Id: icap_respmod.c,v 1.1.2.43 2004/10/19 08:51:23 oliv3 Exp $ + * $Id: icap_respmod.c,v 1.1.2.44 2004/10/19 14:18:18 oliv3 Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.41.6.13.2.27 retrieving revision 1.41.6.13.2.28 diff -u -r1.41.6.13.2.27 -r1.41.6.13.2.28 --- squid/src/protos.h 19 Oct 2004 08:51:23 -0000 1.41.6.13.2.27 +++ squid/src/protos.h 19 Oct 2004 14:18:18 -0000 1.41.6.13.2.28 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.41.6.13.2.27 2004/10/19 08:51:23 oliv3 Exp $ + * $Id: protos.h,v 1.41.6.13.2.28 2004/10/19 14:18:18 oliv3 Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.9.2.32 retrieving revision 1.48.2.9.2.33 diff -u -r1.48.2.9.2.32 -r1.48.2.9.2.33 --- squid/src/structs.h 19 Oct 2004 08:51:24 -0000 1.48.2.9.2.32 +++ squid/src/structs.h 19 Oct 2004 14:18:19 -0000 1.48.2.9.2.33 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.9.2.32 2004/10/19 08:51:24 oliv3 Exp $ + * $Id: structs.h,v 1.48.2.9.2.33 2004/10/19 14:18:19 oliv3 Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ Index: squid/src/typedefs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/typedefs.h,v retrieving revision 1.25.6.1.6.9 retrieving revision 1.25.6.1.6.10 diff -u -r1.25.6.1.6.9 -r1.25.6.1.6.10 --- squid/src/typedefs.h 19 Oct 2004 08:51:25 -0000 1.25.6.1.6.9 +++ squid/src/typedefs.h 19 Oct 2004 14:18:21 -0000 1.25.6.1.6.10 @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.25.6.1.6.9 2004/10/19 08:51:25 oliv3 Exp $ + * $Id: typedefs.h,v 1.25.6.1.6.10 2004/10/19 14:18:21 oliv3 Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/