Hi,

On Sun, Aug 19, 2012 at 06:43:12PM +0200, Sylvain Rochet wrote:
> 
> Here is a patch for this bug, [...]

Well, the previous patch was obviously bogus.

This new patch is following Apache advices about brigades[1] and memory 
usage, it seems like suPHP is using the bad example in suphp_discard_output().

Sylvain

[1] http://httpd.apache.org/docs/trunk/developer/output-filters.html#filtering
diff -Nru a/src/apache2/mod_suphp.c b/src/apache2/mod_suphp.c
--- a/src/apache2/mod_suphp.c	2009-08-03 14:38:38.000000000 +0000
+++ b/src/apache2/mod_suphp.c	2012-09-06 21:36:51.290474099 +0000
@@ -523,17 +523,8 @@
 
 static void suphp_discard_output(apr_bucket_brigade *bb) {
   apr_bucket *b;
-  const char *buf;
-  apr_size_t len;
-  apr_status_t rv;
-  for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) {
-      if (APR_BUCKET_IS_EOS(b)) {
-          break;
-      }
-      rv = apr_bucket_read(b, &buf, &len, APR_BLOCK_READ);
-      if (rv != APR_SUCCESS) {
-          break;
-      }
+  while ((b = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) {
+    APR_BUCKET_REMOVE(b);
   }
 }
 

Attachment: signature.asc
Description: Digital signature

_______________________________________________
suPHP mailing list
[email protected]
https://lists.marsching.com/mailman/listinfo/suphp

Reply via email to