]> granicus.if.org Git - apache/commitdiff
* server/util_filter.c (ap_save_brigade): Be more tolerant of a bucket
authorJoe Orton <jorton@apache.org>
Mon, 1 Nov 2004 23:04:05 +0000 (23:04 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 1 Nov 2004 23:04:05 +0000 (23:04 +0000)
type which neither implements ->setaside nor morphs on ->read, such as
the mod_perl SV bucket type in mod_perl <1.99_17; defer returning an
error in this case until after calling setaside on each bucket.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105664 13f79535-47bb-0310-9956-ffa450edef68

server/util_filter.c

index a294248248999357e8b0dedb30120e14ce39e13b..b6fc91912e3b9a0ad184bd1b03d2f155e289e629 100644 (file)
@@ -532,7 +532,7 @@ AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f,
                                          apr_bucket_brigade **b, apr_pool_t *p)
 {
     apr_bucket *e;
-    apr_status_t rv;
+    apr_status_t rv, srv = APR_SUCCESS;
 
     /* If have never stored any data in the filter, then we had better
      * create an empty bucket brigade so that we can concat.
@@ -561,11 +561,16 @@ AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f,
         }
 
         if (rv != APR_SUCCESS) {
-            return rv;
+            srv = rv;
+            /* Return an error but still save the brigade if
+             * ->setaside() is really not implemented. */
+            if (rv != APR_ENOTIMPL) {
+                return rv;
+            }
         }
     }
     APR_BRIGADE_CONCAT(*saveto, *b);
-    return APR_SUCCESS;
+    return srv;
 }
 
 AP_DECLARE_NONSTD(apr_status_t) ap_filter_flush(apr_bucket_brigade *bb,