]> granicus.if.org Git - apache/commitdiff
Make the error bucket a real meta-data bucket. This means that the
authorRyan Bloom <rbb@apache.org>
Sun, 28 Jan 2001 03:36:02 +0000 (03:36 +0000)
committerRyan Bloom <rbb@apache.org>
Sun, 28 Jan 2001 03:36:02 +0000 (03:36 +0000)
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

CHANGES
modules/http/error_bucket.c

diff --git a/CHANGES b/CHANGES
index f4520673afb230bbb7184dd6f1ee8e19f5b6c65d..44a0fcad6e325f6931ebe86960f1a4fb911ae97f 100644 (file)
--- 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
index d59439b546bf392abc39213a6499b151ebfada25..8d3c6742e050e3b8159282838de6967054933917 100644 (file)
 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;