--------------------- PatchSet 3010 Date: 2001/09/12 14:35:57 Author: adri Branch: peertwiddle Tag: (none) Log: Add some preliminary code to parse the URL request into host:port and admin request. Members: src/neighbors.c:1.12.14.2->1.12.14.3 Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.12.14.2 retrieving revision 1.12.14.3 diff -u -r1.12.14.2 -r1.12.14.3 --- squid/src/neighbors.c 12 Sep 2001 13:57:13 -0000 1.12.14.2 +++ squid/src/neighbors.c 12 Sep 2001 14:35:57 -0000 1.12.14.3 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.12.14.2 2001/09/12 13:57:13 adri Exp $ + * $Id: neighbors.c,v 1.12.14.3 2001/09/12 14:35:57 adri Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1403,6 +1403,16 @@ { http_version_t version; char unknown_req[] = "Unknown or invalid administrative peer request\n"; + LOCAL_ARRAY(char, host, MAX_URL); + LOCAL_ARRAY(char, adminreq, MAX_URL); + int t; + const char *url = strBuf(request->urlpath); + + t = sscanf(url, "/squid-internal-peer/%[^/]/%s", host, adminreq); + if (t < 2) + goto error; + + debug(1, 1) ("peer: %s, adminreq: %s\n", host, adminreq); /* Attempt to parse the peer */ @@ -1416,6 +1426,7 @@ /* Disable - disable the peer */ /* Return valid */ +error: /* Unknown request type, so return it */ httpBuildVersion(&version, 1, 0); httpReplySetHeaders(e->mem_obj->reply,