Re: store entry question

From: Henrik Nordstrom <hno@dont-contact.us>
Date: 16 Apr 2003 16:13:45 +0200

Normally you don't.. instead you create another StoreEntry with the same
key and fill it with your data.. The new object will automatically
invalidate the "older" object as soon as you assign the public key to
your new object.

The exception to this is when Squid is fetching data from the network.
Then a StoreEntry may be reset if it is decided before any data have
been sent to the client that the data retrieved so far is no good and
should be immediately thrown away to allow for another attempt to
retrieve the object. This is about the only case where it is safe to
reset an existing StoreEntry.

What is is actually you are trying to do here?

Regards
Henrik

ons 2003-04-16 klockan 15.39 skrev Matt Tuzzolo:
> Hey,
> I'm trying to reset a store entry and then fill it with my own
> data. My code basically looks like this:
>
> <------(entry contains "</html>")
> storeMemObjectDump(entry->mem_obj);
> storeEntryReset(entry);
> storeAppend(entry, "blah", 4);
> storeMemObjectDump(entry->mem_obj);
> <------(entry now contains "</html>blah" should be "blah")
>
> But storeMemObjectDump prints the same data each time and the client
> still recieves the pre-existing content. Is storeEntryReset
> not actually freeing the data_hdr? I can only find one other call to
> storeEntryReset so I don't have much to go on.
>
> I was previously just appending my data after the read, but this only
> works for dynamically generated sites (where the CL is unknown), so that's
> no good (although some browsers will actually just ignore the
> content-length and read from the socket indefinitely). I need to
> somehow get rid of what's already in this entry and recreate it with my
> own content so this is compatible with browsers that pay attention to the
> content-length.
>
> Any suggestions?
>
> -Matt
>
> ---------------------------
> Matt Tuzzolo
> Merrimack Education Center
> 978.262.4000
> ---------------------------

-- 
Henrik Nordstrom <hno@squid-cache.org>
MARA Systems AB, Sweden
Received on Wed Apr 16 2003 - 08:14:02 MDT

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