On 12/01/2008 11:01 AM, Nick Kew wrote:
>
> On 1 Dec 2008, at 09:31, Ruediger Pluem wrote:
>>>
>>> But do you see any objection to the (IMHO simpler) fix of
>>> removing error buckets as we detect them?
>>
>> Not directly. Could you please propose a concrete patch?
>> It makes discussion easier :-).
>
> I think the one-liner should work, since we don't re-use the error bucket.
> So against trunk, that's:
>
> --- modules/http/http_filters.c (revision 722000)
> +++ modules/http/http_filters.c (working copy)
> @@ -1133,6 +1133,7 @@
> {
> if (AP_BUCKET_IS_ERROR(e) && !eb) {
> eb = e->data;
> + apr_bucket_delete(e);
> continue;
> }
> /*
I guess this could segfault (the status is in eb->status).
Why not cleaning up the whole brigade? IMHO it is of no use
anymore when we do an ap_die and afterwards return AP_FILTER_ERROR;
Index: modules/http/http_filters.c
===================================================================
--- modules/http/http_filters.c (Revision 721833)
+++ modules/http/http_filters.c (Arbeitskopie)
@@ -1145,7 +1145,11 @@
}
}
if (eb) {
- ap_die(eb->status, r);
+ int status;
+
+ status = eb->status;
+ apr_brigade_cleanup(b);
+ ap_die(status, r);
return AP_FILTER_ERROR;
}
Regards
RĂ¼diger