Re: Adding a missing header - Squid 2.7STABLE5

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 3 Dec 2008 15:41:54 +1300 (NZDT)

> Hi!
>
> Since when there's a POST request without 'Content-Length' header
> rises an error, I was
> playing around (just for fun) to add this header to request before the
> request headers gets processed. I've tried to add
> a code like:
>
> if (method == METHOD_POST) {
> if (!httpHeaderHas(req_hdr, HDR_CONTENT_LENGTH) {
> httpHeaderPutSize(req_hdr, HDR_CONTENT_LENGTH, content_length);
> }
> }
>
> But I'm not sure in which point to insert this code. I've tried at
> clientInterpretRequestHeaders(), with
> no success. Seems that the write point is in parseHttpRequest(), but
> in this point clientHttpRequest
> structure is not ready.....
>
> Any tip ? ;-)
>
> regards
> Lucas Brasilino
>

For posts there is no guaranteed point. The full length of POST data is
not necessarily known until its all received and sent.
Think about POST'ing a DVD ISO file to an FTP site.

Amos
Received on Wed Dec 03 2008 - 02:41:57 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 03 2008 - 12:00:03 MST