I've written a HttpReplyClone() routine that clones the given http reply. It copies everything for now but it'll be easier to change to use refcounted string semantics later on.
I then used it in client_side::clientBuildReply() which calls the http parse routine on the given buffer. That buffer is the reply buffer which -should- already be in mem->reply. http://www.creative.net.au/diffs/20070124-storetidyup-1.diff This benchmarks quite well on my p4 here - the 'ab' test fetching anthony-box.gif (160 bytes) over and over jumped from 5300 req/sec to 6900 req/sec. It'll result in less CPU usage during HITs and MISSes and be mostly visible on small object hits. I'll commit this to squid-2-HEAD over the weekend if noone objects. I'll try to tidy up clientBuildReply() a little further before I commit. (Someone should probably port this to Squid-3 once I've finished tidying it up. Squid-3 looks much the same in this respect, parsing the reply even if the reply headers are in memory.) Adrian
