Re: [squid-users] If-Unmodified-Since implementation question

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 11 Mar 2011 22:09:53 +1300

On 11/03/11 12:13, Guy Bashkansky wrote:
> I'm trying to implement the If-Unmodified-Since (IUMS) capability in Squid 2.x.
>
> When a client IUMS request comes, I raise a new request flag iums,
> store the iums time, and send an IMS request to the origin. When the
> origin response comes back, I modify the store entry memory object’s
> reply status according to the IUMS time logic in both
> httpProcessReplyHeader() and clientHandleIMSReply().
>
> This works either when the IUMS precondition is satisfied (then I send
> 200 to client, instead of 304 typically) or for the cache *hit only*
> when the IUMS precondition is unsatisfied (then I send 412 to client,
> instead of 200 typically).
>
> However, when the IUMS precondition is unsatisfied upon cache *miss*,
> the origin's 200 response is still being sent to client, even after I
> modify the store entry memory object’s reply status to 412 in
> httpProcessReplyHeader(). I cannot figure out how and when the status
> is being restored back to 200.

On MISS the client reply is passed through. There may be an IMS check
there somewhere that need updating.
The reply status should be updated at the point of either parsing the
status line, or completed parsing the reply headers.

>
> I’ve set gdb data-watch breakpoints over the store entry memory
> object’s reply status. But then, later during the execution, gdb
> reports watchpoint expression error: bad address.
>
> I’m stuck now, and would really appreciate any help. Thanks.
>

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.11
   Beta testers wanted for 3.2.0.5
Received on Fri Mar 11 2011 - 09:09:57 MST

This archive was generated by hypermail 2.2.0 : Fri Mar 11 2011 - 12:00:01 MST