--------------------- PatchSet 6625 Date: 2005/04/26 16:09:59 Author: chtsanti Branch: icap-2_5 Tag: (none) Log: When the upload of an object aborted by the web client the squids died in an assertion. Maybe the last of the serious bugs which caused to the squid-icap frequent crashes.... Members: src/client_side.c:1.47.2.28.2.27->1.47.2.28.2.28 src/http.c:1.17.6.3.6.33->1.17.6.3.6.34 src/icap_reqmod.c:1.1.2.43->1.1.2.44 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.28.2.27 retrieving revision 1.47.2.28.2.28 diff -u -r1.47.2.28.2.27 -r1.47.2.28.2.28 --- squid/src/client_side.c 28 Mar 2005 18:03:05 -0000 1.47.2.28.2.27 +++ squid/src/client_side.c 26 Apr 2005 16:09:59 -0000 1.47.2.28.2.28 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.28.2.27 2005/03/28 18:03:05 chtsanti Exp $ + * $Id: client_side.c,v 1.47.2.28.2.28 2005/04/26 16:09:59 chtsanti Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -921,16 +921,15 @@ http->next = NULL; dlinkDelete(&http->active, &ClientActiveRequests); #if HS_FEAT_ICAP - /* The icap_reqmod is already free...(I must check it again.../chtsanti) - if (NULL != http->icap_reqmod) { - if (cbdataValid(http->icap_reqmod)) + /*In the case that the upload of data breaks, we need this code here .... */ + if (NULL != http->icap_reqmod){ + if(cbdataValid(http->icap_reqmod)) if (http->icap_reqmod->icap_fd > -1){ - debug(81,5) ("in ICAP reqmod:client_side.c closing %d\n",http->icap_reqmod->icap_fd); comm_close(http->icap_reqmod->icap_fd); - } + } cbdataUnlock(http->icap_reqmod); + http->icap_reqmod=NULL; } - */ #endif cbdataFree(http); } Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.17.6.3.6.33 retrieving revision 1.17.6.3.6.34 diff -u -r1.17.6.3.6.33 -r1.17.6.3.6.34 --- squid/src/http.c 24 Apr 2005 15:16:49 -0000 1.17.6.3.6.33 +++ squid/src/http.c 26 Apr 2005 16:10:09 -0000 1.17.6.3.6.34 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.17.6.3.6.33 2005/04/24 15:16:49 chtsanti Exp $ + * $Id: http.c,v 1.17.6.3.6.34 2005/04/26 16:10:09 chtsanti Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -599,7 +599,9 @@ comm_close(fd); return; } - } + /*The folowing entry can not be marked as aborted. + The StoreEntry icap_writer->respmod.entry used when the icap_write used......*/ + } else #endif if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) { Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.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_reqmod.c 5 Apr 2005 17:57:29 -0000 1.1.2.43 +++ squid/src/icap_reqmod.c 26 Apr 2005 16:10:16 -0000 1.1.2.44 @@ -1,6 +1,6 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.43 2005/04/05 17:57:29 chtsanti Exp $ + * $Id: icap_reqmod.c,v 1.1.2.44 2005/04/26 16:10:16 chtsanti Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -158,8 +158,11 @@ /* Do we expect a request-body? */ if (request->content_length > 0) { debug(81, 5) ("handing request bodies in ICAP REQMOD\n"); + if (request->body_reader_data) + cbdataUnlock(request->body_reader_data); request->body_reader = icapReqModBodyReader; request->body_reader_data = icap; /* XXX cbdataLock? */ + cbdataLock(icap); /*Yes sure .....*/ memBufDefInit(&icap->reqmod.http_entity.buf); } if (clientCachable(http))