--------------------- PatchSet 5048 Date: 2002/09/19 08:21:49 Author: rbcollins Branch: fixrange Tag: (none) Log: more store client knowledge into store_client.c Members: src/client_side_reply.c:1.4.6.14->1.4.6.15 src/protos.h:1.61.2.4->1.61.2.5 src/store_client.c:1.14.2.7->1.14.2.8 Index: squid/src/client_side_reply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_reply.c,v retrieving revision 1.4.6.14 retrieving revision 1.4.6.15 diff -u -r1.4.6.14 -r1.4.6.15 --- squid/src/client_side_reply.c 17 Sep 2002 21:12:16 -0000 1.4.6.14 +++ squid/src/client_side_reply.c 19 Sep 2002 08:21:49 -0000 1.4.6.15 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.c,v 1.4.6.14 2002/09/17 21:12:16 rbcollins Exp $ + * $Id: client_side_reply.c,v 1.4.6.15 2002/09/19 08:21:49 rbcollins Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -214,12 +214,9 @@ } http->request->flags.refresh = 1; #if STORE_CLIENT_LIST_DEBUG - /* - * Assert that 'http' is already a client of old_entry. If - * it is not, then the beginning of the object data might get - * freed from memory before we need to access it. + /* Prevent a race with the store client memory free routines */ - assert(context->sc->owner == context); + assert(storeClientIsThisAClient (context->sc, context); #endif /* Prepare to make a new temporary request */ clientReplyContextSaveState(context, http); Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.61.2.4 retrieving revision 1.61.2.5 diff -u -r1.61.2.4 -r1.61.2.5 --- squid/src/protos.h 17 Sep 2002 21:12:16 -0000 1.61.2.4 +++ squid/src/protos.h 19 Sep 2002 08:21:49 -0000 1.61.2.5 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.61.2.4 2002/09/17 21:12:16 rbcollins Exp $ + * $Id: protos.h,v 1.61.2.5 2002/09/19 08:21:49 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1057,6 +1057,7 @@ extern off_t storeLowestMemReaderOffset(const StoreEntry * entry); extern void InvokeHandlers(StoreEntry * e); extern int storePendingNClients(const StoreEntry * e); +extern int storeClientIsThisAClient(store_client *sc, void *someClient); extern const char *getMyHostname(void); Index: squid/src/store_client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_client.c,v retrieving revision 1.14.2.7 retrieving revision 1.14.2.8 diff -u -r1.14.2.7 -r1.14.2.8 --- squid/src/store_client.c 16 Sep 2002 22:58:17 -0000 1.14.2.7 +++ squid/src/store_client.c 19 Sep 2002 08:21:49 -0000 1.14.2.8 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.14.2.7 2002/09/16 22:58:17 rbcollins Exp $ + * $Id: store_client.c,v 1.14.2.8 2002/09/19 08:21:49 rbcollins Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -66,8 +66,16 @@ } return NULL; } + +int +storeClientIsThisAClient(store_client *sc, void *someClient) +{ + return sc->owner == someClient; +} + #endif + static store_client_t storeClientType(StoreEntry * e) {