Replacing Image content in Storeentry

From: Rich Maring <squid@dont-contact.us>
Date: Sat, 10 Jun 2006 18:14:46 -0400

First, thank you Henrik for your reply to my post the other day,
Re: [squid-users] Processing entire objects before callback toclient-side.
Answered my question precisely and allowed me to continue to move
forward in my project. You moved it to squid-dev so I thought I
would post this here this time.

As a follow-up to that post, I am wanting to modify or replace
the contents of a storeentry()if it is an image mime-type.
I am using storebuffer() to accumulate the object in the storeentry
without sending to the client-side until after I decide if I should
Modify or replace the image object.

When httpReadReply is finished, and case 1: is true, I read the mime-type,
and if an image, I want to replace the contents of the storeentry
with a modified image of equal size, etc.

I have tried storeEntryReset() with a storeAppendEntry() of my
image file, but have been unable to find where the 'body' of the
object is kept by storeEntry() and cannot get it to work.

I found a previos post where you stated: "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."

Could you please explain;

1) how to create a new storeentry with the same key.

2) how to fill it with my data (a different image of same dimension.)
   Either created on the fly with GD or pulled from disk.

3) how to assign it the same public key, and how that invalidates
   the old image object.

I am looking to inject this 'replace an image' code in 'http.c' in function
httpReadReply() immediately after the 'case 1:' determination that my object
is fully contained in the storeentry(entry) and prior to notifying the
client-side to read it.

Thank you in advance for your direction in this.

Rich Maring
Tribinium Corporation
Received on Sat Jun 10 2006 - 16:39:08 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Jun 30 2006 - 12:00:02 MDT