--------------------- PatchSet 5993 Date: 2003/10/27 17:33:37 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: Change assertion into a soft error when Squid does not find end of ICAP headers within SQUID_TCP_SO_RCVBUF bytes. Members: src/icap_common.c:1.1.2.15->1.1.2.16 Index: squid/src/icap_common.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_common.c,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -r1.1.2.15 -r1.1.2.16 --- squid/src/icap_common.c 23 Oct 2003 18:39:42 -0000 1.1.2.15 +++ squid/src/icap_common.c 27 Oct 2003 17:33:37 -0000 1.1.2.16 @@ -1,5 +1,5 @@ /* - * $Id: icap_common.c,v 1.1.2.15 2003/10/23 18:39:42 uid131750 Exp $ + * $Id: icap_common.c,v 1.1.2.16 2003/10/27 17:33:37 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -387,8 +387,12 @@ * buffer, so double it and try to peek again. */ peek_sz *= 2; - assert(peek_sz < SQUID_TCP_SO_RCVBUF); - /* XXX return an error instead of the assertion */ + if (peek_sz >= SQUID_TCP_SO_RCVBUF) { + debug(81, 1) ("icapReadHeader: Failed to find end of ICAP header\n"); + debug(81, 1) ("\twithin first %d bytes of response\n", SQUID_TCP_SO_RCVBUF); + debug(81, 1) ("\tpossible persistent connection bug/confusion\n"); + return -1; + } } /* * Now actually read the data from the kernel