httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [PATCH] dechunking, body filtering
Date Mon, 16 Oct 2000 21:29:42 GMT

> > <brigade_bgets snipped for brevity>
> > 
> > Why isn't this just getline?  This does a bit less than getline, but
> > getline is already there, and it is one less place for things to go wrong.
> > 
> Hmmm, reusing code that gets pounded is a good idea.  But it won't work
> as-is because of minor differences in parms, function, and environment
> (filter vs. non-filter).

But this is a non-issue because of how it should be used.  The only
problem I see is that brigade_bgets requires that the bb is received
before we call brigade_bgets.  But this is solved by removing the call to
get_brigade.  Then the only remaining problem is that bgets can save the
buckets.  But, that only happens when read_body is REQUEST_CHUNKED_PASS is
true, which only happens when we are throwing away the data.  In this
case, I have no problem as all with re-wrapping the data in a new bucket,
because the browser was stupid to send us a body with a method that
doesn't use it.

> I'm doing minor tweaks to getline() at the moment for other reasons. 
> Once I get done with that, I'll see if we can factor out the common
> denominator & turn getline() into a wrapper.

I don't see the issue.  I haven't tested this at all, but all I see as
being necessary is:

Index: http_protocol.c
RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
retrieving revision 1.177
diff -u -d -b -w -r1.177 http_protocol.c
--- http_protocol.c     2000/10/16 20:08:14     1.177
+++ http_protocol.c     2000/10/16 21:27:56
@@ -903,11 +903,7 @@
             char line[30];

-            if ((rv = ap_get_brigade(f->next, bb, AP_GET_LINE)) != APR_SUCCESS) {
-                return rv;
-            }
-            if ((rv = brigade_bgets(bb, ctx->remove_chunk_proto,
-                                    line, sizeof(line))) != APR_SUCCESS) {
+            if ((rv = getline(line, sizeof(line), f->c, 0)) != APR_SUCCESS) {
                 return rv;
             switch(ctx->state) {


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message