httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: mod_fastcgi for 1.2dev
Date Wed, 23 Oct 1996 04:49:11 GMT
Brian Behlendorf wrote:
> 
> On Tue, 15 Oct 1996, Mark Brown wrote:
> > I have started getting complaints from FastCGI developers who
> > have pulled 1.2dev kits.  I would rather not be in the business
> > of distributing patches to 1.2dev.
> > 
> >   1) Would someone please commit my mod_fastcgi patch?
> 
> Committed.
> 
> >   2) Would someone please either commit my get_client_block patch,
> >      or commit another patch that allows mod_fastcgi to work?
> 
> I seem to remember Alexei still had questions about it; here's the original
> post to refresh peoples' memories.  Could we get some comments on this, folks? 

As far as I can work out, Mark's patch is correct (but reversed). But it still
doesn't work correctly for 1 byte buffers (or any small buffer) - the trailing
headers are not read correctly.

Cheers,

Ben.

> 
> 	Brian
> 
> ====
> 
> Message-Id: <199610110102.VAA00442@breckenridge.openmarket.com>
> To: new-httpd@hyperreal.com
> Subject: get_client_block patch
> Date: Thu, 10 Oct 1996 21:02:22 -0400
> From: Mark Brown <mbrown@OpenMarket.com>
> 
> In a recent 1.2dev snapshot (apache_19961010010010.tar.gz), the
> get_client_block function arbitrarily tosses one byte of
> the caller's buffer.  Thus if the caller's buffer is a single byte long,
> get_client_block always signals EOF.  (mod_fastcgi tickled this
> bug by passing bufsiz == len_to_read, after which len_to_read == 1.)
> 
> Here's the fix.
> 
>     --mark
> 
> * * * * *
> 
> *** http_protocol.c     Wed Oct  9 22:54:01 1996
> --- http_protocol.c.orig        Wed Oct  9 22:53:20 1996
> ***************
> *** 1146,1153 ****
>       long c, len_read, len_to_read = r->remaining;
>   
>       if (!r->read_chunked) {   /* Content-length read */
> !       if (len_to_read > bufsiz)
> !           len_to_read = bufsiz;
>         len_read = bread(r->connection->client, buffer, len_to_read);
>         r->remaining -= len_read;
>         return len_read;
> --- 1146,1153 ----
>       long c, len_read, len_to_read = r->remaining;
>   
>       if (!r->read_chunked) {   /* Content-length read */
> !       if (len_to_read >= bufsiz)
> !           len_to_read = bufsiz - 1;
>         len_read = bread(r->connection->client, buffer, len_to_read);
>         r->remaining -= len_read;
>         return len_read;
> 
> * * * * *
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.            Apache Group member (http://www.apache.org)

Mime
View raw message