Re: storeGet() -> storeGetPublic() ?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 05 Jan 2001 21:21:35 +0100

Feel free to.

Or in case of FTP you can just as well remove the storeRelease (and the
storeGet to find the object to release). It is an old temporary thing to
make sure old (prior to upgrade) cached authenticated entries are not
given out to people not knowing the password.

/Henrik

Adrian Chadd wrote:
>
> 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 Takes
Received on Fri Jan 05 2001 - 13:36:23 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:10 MST