You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2002/04/16 21:49:36 UTC

[PATCH] content-length filter never runs for a subrequest, right?

zap some bogus code, add a very clear comment that makes the code run
slightly slower for AP_DEBUG enthusiasts

Index: server/protocol.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
retrieving revision 1.96
diff -u -r1.96 protocol.c
--- server/protocol.c	16 Apr 2002 05:43:09 -0000	1.96
+++ server/protocol.c	16 Apr 2002 19:50:57 -0000
@@ -1129,6 +1129,8 @@
     apr_bucket_brigade *more, *split;
     apr_read_type_e eblock = APR_NONBLOCK_READ;
 
+    AP_DEBUG_ASSERT(r->main == NULL);
+
     ctx = f->ctx;
     if (!ctx) { /* first time through */
         f->ctx = ctx = apr_pcalloc(r->pool, sizeof(struct content_length_ctx));
@@ -1238,8 +1240,7 @@
     }
 
     if ((ctx->curr_len < AP_MIN_BYTES_TO_WRITE) && !eos) {
-        return ap_save_brigade(f, &ctx->saved, &b,
-                               (r->main) ? r->main->pool : r->pool);
+        return ap_save_brigade(f, &ctx->saved, &b, r->pool);
     }
 
     if (ctx->compute_len) {

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...