storeSetPublicKey: newkey generated twice

From: Vinod Patel <vinod@dont-contact.us>
Date: Tue, 19 Oct 2004 16:30:40 +0530

Hi all,
    I have found that public key is being generated twice here. May be i
have misunderstood it. I would appreciate if someone could guide me.

Version: squid-2.5-Stable2
File: store.c
routine: storeSetPublicKey
LineNo: 402 to 462

    Outline for code is: -
402: if (mem->request) {
403: StoreEntry *pe;
                    ...
                    /* some vary header stuff */
                    ...
451: newkey = storeKeyPublicByRequest(mem->request);
452: } else
453: newkey = storeKeyPublic(mem->url, mem->method);

        /* Now we have newkey i.e. public key */

454: if ((e2 = (StoreEntry *) hash_lookup(store_table, newkey))) {
455: debug(20, 3) ("storeSetPublicKey: Making old '%s'
private.\n", mem->url);

                    ...
                    ...
            /* Here newkey is generated again */
458: if (mem->request)
459: newkey = storeKeyPublicByRequest(mem->request);
460: else
461: newkey = storeKeyPublic(mem->url, mem->method);
        }

I don't understand why do we need to regenerate the key (Line 458 to 461),
when we already have already generated it at Line 451 to 453.

Thanx for help,

Rgds,
Vinod
Received on Tue Oct 19 2004 - 05:05:54 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Oct 31 2004 - 12:00:02 MST