I think there is a problem with the ap_f* wrappers in httpd.  If the flush
function is invoked from within apr_brigade_write, we end up skipping over
a filter.

The ap_f* fuctions are defined as:

#define ap_fputs(f, bb, str) \
    apr_brigade_puts(bb, ap_filter_flush, (f)->next, str)

If we decide to flush from within apr_brigade_write, ap_filter_flush is
called with f->next, causing f->next->next to be the next filter to run.
(skipping over f->next).

A small patch is attached,

Thanks,

-Ryan
Index: util_filter.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/include/util_filter.h,v
retrieving revision 1.48
diff -u -r1.48 util_filter.h
--- util_filter.h       2001/03/17 15:58:09     1.48
+++ util_filter.h       2001/04/12 17:56:41
@@ -402,7 +402,7 @@
  * @param nbyte The number of bytes in the data
  */
 #define ap_fwrite(f, bb, data, nbyte) \
-       apr_brigade_write(bb, ap_filter_flush, (f)->next, data, nbyte)
+       apr_brigade_write(bb, ap_filter_flush, f, data, nbyte)
 
 /**
  * Write a buffer for the current filter, buffering if possible.
@@ -411,7 +411,7 @@
  * @param str The string to write
  */
 #define ap_fputs(f, bb, str) \
-       apr_brigade_puts(bb, ap_filter_flush, (f)->next, str)
+       apr_brigade_puts(bb, ap_filter_flush, f, str)
 
 /**
  * Write a character for the current filter, buffering if possible.
@@ -420,7 +420,7 @@
  * @param c The character to write
  */
 #define ap_fputc(f, bb, c) \
-       apr_brigade_putc(bb, ap_filter_flush, (f)->next, c)
+       apr_brigade_putc(bb, ap_filter_flush, f, c)
 
 /**
  * Write an unspecified number of strings to the current filter

Reply via email to