Re: 1xx response forwarding

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 16 Aug 2010 22:06:05 +0000

On Mon, 16 Aug 2010 15:53:42 -0600, Alex Rousskov
<rousskov_at_measurement-factory.com> wrote:
> Hello,
>
> We need to forward 1xx control messages from servers to clients. I
> see two implementation options:
>
> 1. Use Store. Squid client side expects responses via storeClientCopy,
> so we will be using the usual/normal code paths. Multiple 1xx responses
> may be handled with relative ease. The 1xx responses in Store will be
> treated kind of as regular response headers, except they will not be
> cached and such. The code will need to "skip" them until they reach the
> socket-writing client.
>
> 2. Bypass Store. Contact fwdStart caller (e.g., clientReplyContext)
> directly and give it a 1xx response to forward. Store code remains
> unchanged. It may be difficult to get from the fwdStart caller to the
> client socket and comm_write. It will be difficult to handle multiple
> 1xx responses or a regular response that arrives before we are done with

> writing 1xx response (all unusual, but can happen!).
>
> Both approaches may have to deal with crazy offset management,
> clientStreams manipulations, and other client-side mess.
>
>
> Do you see any other options? Which option is the best?
>
>
> Thank you,
>
> Alex.

My earlier plan if I did it was to do (2). The complication only occurs at
one point, finding the client FD.
comm_write() should not be altering offset of the higher level store stuff
directly. If it is that is a bug to be fixed.

Pipelining the responses one at a time with a simple block on further
reply passing-on until the existing header set has been finished with gets
around any trickiness with multiple or early real responses.

That said, either way is fine if done right, up to the implementer.

Amos
Received on Mon Aug 16 2010 - 22:06:19 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 17 2010 - 12:00:04 MDT