--------------------- PatchSet 10209 Date: 2007/12/12 08:59:27 Author: adri Branch: s27_adri Tag: (none) Log: Modify the packer calls to take a length and (maybe) avoid an internal strlen(). Members: src/HttpHdrCc.c:1.7.16.1->1.7.16.2 src/HttpHeader.c:1.28.6.1.4.5->1.28.6.1.4.6 Index: squid/src/HttpHdrCc.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHdrCc.c,v retrieving revision 1.7.16.1 retrieving revision 1.7.16.2 diff -u -r1.7.16.1 -r1.7.16.2 --- squid/src/HttpHdrCc.c 10 Dec 2007 18:59:38 -0000 1.7.16.1 +++ squid/src/HttpHdrCc.c 12 Dec 2007 08:59:27 -0000 1.7.16.2 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrCc.c,v 1.7.16.1 2007/12/10 18:59:38 adri Exp $ + * $Id: HttpHdrCc.c,v 1.7.16.2 2007/12/12 08:59:27 adri Exp $ * * DEBUG: section 65 HTTP Cache Control Header * AUTHOR: Alex Rousskov @@ -199,7 +199,7 @@ if (EBIT_TEST(cc->mask, flag) && flag != CC_OTHER) { /* print option name */ - packerPrintf(p, (pcount ? ", %s" : "%s"), strBuf(CcFieldsInfo[flag].name)); + packerPrintf(p, (pcount ? ", %.*s" : "%.*s"), strLen2(CcFieldsInfo[flag].name), strBuf2(CcFieldsInfo[flag].name)); /* handle options with values */ if (flag == CC_MAX_AGE) @@ -215,7 +215,7 @@ } } if (strLen(cc->other)) - packerPrintf(p, (pcount ? ", %s" : "%s"), strBuf(cc->other)); + packerPrintf(p, (pcount ? ", %.*s" : "%.*s"), strLen2(cc->other), strBuf2(cc->other)); } void Index: squid/src/HttpHeader.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHeader.c,v retrieving revision 1.28.6.1.4.5 retrieving revision 1.28.6.1.4.6 diff -u -r1.28.6.1.4.5 -r1.28.6.1.4.6 --- squid/src/HttpHeader.c 12 Dec 2007 08:04:09 -0000 1.28.6.1.4.5 +++ squid/src/HttpHeader.c 12 Dec 2007 08:59:27 -0000 1.28.6.1.4.6 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.28.6.1.4.5 2007/12/12 08:04:09 adri Exp $ + * $Id: HttpHeader.c,v 1.28.6.1.4.6 2007/12/12 08:59:27 adri Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -1340,9 +1340,9 @@ httpHeaderEntryPackInto(const HttpHeaderEntry * e, Packer * p) { assert(e && p); - packerAppend(p, strBuf(e->name), strLen(e->name)); + packerAppend(p, strBuf2(e->name), strLen2(e->name)); packerAppend(p, ": ", 2); - packerAppend(p, strBuf(e->value), strLen(e->value)); + packerAppend(p, strBuf2(e->value), strLen2(e->value)); packerAppend(p, "\r\n", 2); }