--------------------- PatchSet 10424 Date: 2008/01/21 12:53:40 Author: adri Branch: s27_adri Tag: (none) Log: Trim out unused code. Members: src/HttpHeaderTools.c:1.14.10.5->1.14.10.6 src/HttpMsg.c:1.12.12.4->1.12.12.5 src/HttpRequest.c:1.17.10.1.4.6->1.17.10.1.4.7 src/protos.h:1.146.2.4.4.41->1.146.2.4.4.42 Index: squid/src/HttpHeaderTools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHeaderTools.c,v retrieving revision 1.14.10.5 retrieving revision 1.14.10.6 diff -u -r1.14.10.5 -r1.14.10.6 --- squid/src/HttpHeaderTools.c 21 Jan 2008 03:36:15 -0000 1.14.10.5 +++ squid/src/HttpHeaderTools.c 21 Jan 2008 12:53:40 -0000 1.14.10.6 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.c,v 1.14.10.5 2008/01/21 03:36:15 adri Exp $ + * $Id: HttpHeaderTools.c,v 1.14.10.6 2008/01/21 12:53:40 adri Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -225,64 +225,6 @@ } -/* - * parses a given string then packs compiled headers and compares the result - * with the original, reports discrepancies - */ -#if UNUSED_CODE -void -httpHeaderTestParser(const char *hstr) -{ - static int bug_count = 0; - int hstr_len; - int parse_success; - HttpHeader hdr; - int pos; - Packer p; - MemBuf mb; - assert(hstr); - /* skip start line if any */ - if (!strncasecmp(hstr, "HTTP/", 5)) { - const char *p = strchr(hstr, '\n'); - if (p) - hstr = p + 1; - } - /* skip invalid first line if any */ - if (xisspace(*hstr)) { - const char *p = strchr(hstr, '\n'); - if (p) - hstr = p + 1; - } - hstr_len = strlen(hstr); - /* skip terminator if any */ - if (strstr(hstr, "\n\r\n")) - hstr_len -= 2; - else if (strstr(hstr, "\n\n")) - hstr_len -= 1; - httpHeaderInit(&hdr, hoReply); - /* debugLevels[55] = 8; */ - parse_success = httpHeaderParse(&hdr, hstr, hstr + hstr_len); - /* debugLevels[55] = 2; */ - if (!parse_success) { - debug(66, 2) ("TEST (%d): failed to parsed a header: {\n%s}\n", bug_count, hstr); - return; - } - /* we think that we parsed it, veryfy */ - memBufDefInit(&mb); - packerToMemInit(&p, &mb); - httpHeaderPackInto(&hdr, &p); - if ((pos = abs(httpHeaderStrCmp(hstr, mb.buf, hstr_len)))) { - bug_count++; - debug(66, 2) ("TEST (%d): hdr parsing bug (pos: %d near '%s'): expected: {\n%s} got: {\n%s}\n", - bug_count, pos, hstr + pos, hstr, mb.buf); - } - httpHeaderClean(&hdr); - packerClean(&p); - memBufClean(&mb); -} -#endif - - /* like strncasecmp but ignores ws characters */ #if UNUSED_CODE static int Index: squid/src/HttpMsg.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpMsg.c,v retrieving revision 1.12.12.4 retrieving revision 1.12.12.5 diff -u -r1.12.12.4 -r1.12.12.5 --- squid/src/HttpMsg.c 20 Jan 2008 10:26:05 -0000 1.12.12.4 +++ squid/src/HttpMsg.c 21 Jan 2008 12:53:40 -0000 1.12.12.5 @@ -1,6 +1,6 @@ /* - * $Id: HttpMsg.c,v 1.12.12.4 2008/01/20 10:26:05 adri Exp $ + * $Id: HttpMsg.c,v 1.12.12.5 2008/01/21 12:53:40 adri Exp $ * * DEBUG: section 74 HTTP Message * AUTHOR: Alex Rousskov @@ -36,15 +36,6 @@ #include "squid.h" int -httpMsgParseRequestHeader(request_t * req, HttpMsgBuf * hmsg) -{ - const char *s, *e; - s = hmsg->buf + hmsg->h_start; - e = hmsg->buf + hmsg->h_end + 1; - return httpHeaderParse(&req->header, s, e); -} - -int httpMsgParseRequestHeaderBuf(request_t *req, HttpMsgBuf *hmsg) { return httpHeaderParseBuf(&req->header, hmsg->nb, hmsg->h_start); Index: squid/src/HttpRequest.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpRequest.c,v retrieving revision 1.17.10.1.4.6 retrieving revision 1.17.10.1.4.7 diff -u -r1.17.10.1.4.6 -r1.17.10.1.4.7 --- squid/src/HttpRequest.c 22 Dec 2007 14:32:11 -0000 1.17.10.1.4.6 +++ squid/src/HttpRequest.c 21 Jan 2008 12:53:43 -0000 1.17.10.1.4.7 @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.c,v 1.17.10.1.4.6 2007/12/22 14:32:11 adri Exp $ + * $Id: HttpRequest.c,v 1.17.10.1.4.7 2008/01/21 12:53:43 adri Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -156,17 +156,6 @@ packerClean(&p); } -#if UNUSED_CODE -void -httpRequestSetHeaders(request_t * req, method_t method, const char *uri, const char *header_str) -{ - assert(req && uri && header_str); - assert(!req->header.len); - httpHeaderParse(&req->header, header_str, header_str + strlen(header_str)); -} - -#endif - /* returns the length of request line + headers + crlf */ int httpRequestPrefixLen(const request_t * req) Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.146.2.4.4.41 retrieving revision 1.146.2.4.4.42 diff -u -r1.146.2.4.4.41 -r1.146.2.4.4.42 --- squid/src/protos.h 21 Jan 2008 03:50:25 -0000 1.146.2.4.4.41 +++ squid/src/protos.h 21 Jan 2008 12:53:46 -0000 1.146.2.4.4.42 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.146.2.4.4.41 2008/01/21 03:50:25 adri Exp $ + * $Id: protos.h,v 1.146.2.4.4.42 2008/01/21 12:53:46 adri Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1410,7 +1410,6 @@ extern void HttpMsgBufInit(HttpMsgBuf * hmsg, buf_t *buf, int offset, size_t size); extern void httpMsgBufDone(HttpMsgBuf * hmsg); extern int httpMsgParseRequestLine(HttpMsgBuf * hmsg); -extern int httpMsgParseRequestHeader(request_t * req, HttpMsgBuf * hmsg); extern int httpMsgParseRequestHeaderBuf(request_t *req, HttpMsgBuf *hmsg); extern int httpMsgFindHeadersEnd(HttpMsgBuf * hmsg);