Justin Erenkrantz wrote:

>So, I'm thinking the appropriate check is to stop at EOS or 
>SENTINEL.  There is no good reason to continue processing if we 
>see an EOS.  But, we have a potentially saved brigade to handle.
>So, what do we do?  Perhaps this patch might be better:
>
>Index: modules/filters/mod_include.c
>===================================================================
>RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
>retrieving revision 1.166
>diff -u -r1.166 mod_include.c
>--- modules/filters/mod_include.c      2001/12/08 03:14:50     1.166
>+++ modules/filters/mod_include.c      2001/12/14 18:37:48
>@@ -2700,7 +2700,7 @@
>                   ap_escape_shell_cmd(r->pool, arg_copy));
>     }
> 
>-    while (dptr != APR_BRIGADE_SENTINEL(*bb)) {
>+    while (dptr != APR_BRIGADE_SENTINEL(*bb) || !APR_BUCKET_IS_EOS(dptr)) {
>         /* State to check for the STARTING_SEQUENCE. */
>         if ((ctx->state == PRE_HEAD) || (ctx->state == PARSE_HEAD)) {
>             int do_cleanup = 0;
>@@ -2941,6 +2941,22 @@
> 
>             ctx->state     = PRE_HEAD;
>         }
>+    }
>+
>+    /* We have nothing more to send, stop now. */
>+    if (APR_BUCKET_IS_EOS(dptr)) {
>+        /* Ensure that EOS is sent along. */
>+        APR_BUCKET_REMOVE(dptr);
>+        APR_BUCKET_INSERT_TAIL(*bb, dptr);
>

Thanks, this patch seems to fix the problem.  One question,
though: why remove the bucket and then insert it at the end
of the same brigade?  Is that just in case there's an EOS in
the middle of the brigade?

--Brian


Reply via email to