From: Ryan Bloom Date: Sun, 28 Jan 2001 03:36:02 +0000 (+0000) Subject: Make the error bucket a real meta-data bucket. This means that the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=701665c76c4b455839f045c7d9d7510c40d96b90;p=apache Make the error bucket a real meta-data bucket. This means that the bucket length is 0, and a read returns NULL data. If one of these buckets is passed down after the headers are sent, this data will just be ignored. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87883 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index f4520673af..44a0fcad6e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0b1 + *) Make the error bucket a real meta-data bucket. This means that the + bucket length is 0, and a read returns NULL data. If one of these + buckets is passed down after the headers are sent, this data will + just be ignored. [Greg Stein] + *) The prefork MPM wasn't killing child processes correctly if a restart signal was received while the process was serving a request. The child process would become the equivalent of a second parent process. If diff --git a/modules/http/error_bucket.c b/modules/http/error_bucket.c index d59439b546..8d3c6742e0 100644 --- a/modules/http/error_bucket.c +++ b/modules/http/error_bucket.c @@ -63,10 +63,8 @@ static apr_status_t error_read(apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block) { - ap_bucket_error *e = b->data; - - *str = e->start; - *len = b->length; + *str = NULL; + *len = 0; return APR_SUCCESS; } @@ -80,9 +78,11 @@ AP_DECLARE(apr_bucket *) ap_bucket_make_error(apr_bucket *b, int error, return NULL; } h->status = error; - h->start = apr_pstrdup(p, buf); + if (buf) { + h->start = apr_pstrdup(p, buf); + } - b->length = strlen(h->start); + b->length = 0; b->type = &ap_bucket_type_error; b->data = h; return b;