I've noticed that in ftp.c we call storeKeyPublic and then storeGet
on that key, where we could just call storeGetPublic().
This patch makes sense to me:
Index: ftp.c
===================================================================
RCS file: /cvsroot/squid/squid/src/ftp.c,v
retrieving revision 1.2.2.3
diff -u -r1.2.2.3 ftp.c
--- ftp.c 2000/12/13 09:45:02 1.2.2.3
+++ ftp.c 2001/01/05 12:09:28
@@ -1044,7 +1044,6 @@
FtpStateData *ftpState = xcalloc(1, sizeof(FtpStateData));
HttpReply *reply;
StoreEntry *pe = NULL;
- const cache_key *key = NULL;
cbdataAdd(ftpState, cbdataXfree, 0);
debug(9, 3) ("ftpStart: '%s'\n", url);
statCounter.server.all.requests++;
@@ -1076,8 +1075,8 @@
ftpState->user, request->port);
}
/* eject any old cached object */
- key = storeKeyPublic(entry->mem_obj->url, entry->mem_obj->method);
- if ((pe = storeGet(key)) != NULL)
+ pe = storeGetPublic(entry->mem_obj->url, entry->mem_obj->method);
+ if (pe != NULL)
storeRelease(pe);
/* create reply */
reply = entry->mem_obj->reply;
Does anyone see any problem with this ?
I've noticed the same in peer_digest.c - it uses the key a few
times, but it could be replaced with storeGetPublic().
I am asking because I'm going to have to turn storeGetPublic() into
a blocking operation (because it will become the old storeOpen() -
it could possibly require a disk operation to get the metadata
in before it returns..) and I'd like to kill the rest of the storeGet()
calls.
On a side note, the modio code will have some very broken icp/htcp/digest
code now that the "key" concept has gone away. I'd like someone to
think about how they could be made to work again ..
Adrian
-- Adrian Chadd "Here's five for the cake, and <adrian@creative.net.au> five to buy a clue." - Ryan, Whatever it TakesReceived on Fri Jan 05 2001 - 05:16:47 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:10 MST