Search squid archive

Replacing image content in storeentry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, thank you Henrik for your reply to my post the other day,
Re:  Processing entire objects before callback to client-side.
Answered my question precisely and allowed me to continue to move 
forward in my project.

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



[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux