Re: bug: squid hangs during https POST

From: Adrian Chadd <adrian@dont-contact.us>
Date: Thu, 18 Oct 2001 22:40:28 +0800

On Wed, Oct 17, 2001, Noel Burton-Krahn wrote:
> Got it!
>
> I added a pending_method() to the file struct. Now every file's
> pending_method() is called just before just before poll() or select().
> If it returns true, skip the select and go straight to the read. This
> fixes the bug where squid would hang on long POST bodies sent through
> SSL.
>
> My patch also contains code to add a X-Forwarded-URI header to
> forwarded requests. That's so the downstream server can accurately
> reconstruct the URI the client used originally.
>
> This has only been tested on a Linux-2.4.2, redhat-7.1 box.

Right. I think for this, we need some kind of function to determine
whether there's any more data available for a given filedescriptor,
and this is called instead of the read handler.

This way, this function can call the "real" read callback, check
if there's any data left in the buffer after the callback returns,
and then call the read handler (again!) until the buffer is empty.

This should solve your problem. Implementation is left as an
exercise to the reader, but personally I'd look at having some form
of indirection set in the fde struct to call the callback,
and this indirection is "overridden" like how SSL does it through
FD_READ_METHOD, FD_WRITE_METHOD.

Henrik, anyone, do you have any other bright ideas?

Adrian

-- 
Adrian Chadd			"Auntie Em, Hate you. Hate Kansas.
<adrian@creative.net.au>	  Taking the dog."
				    -- Dorothy
Received on Thu Oct 18 2001 - 08:40:24 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:33 MST