]> granicus.if.org Git - apache/commitdiff
ap_sub_req_output_filter: don't pass along a brigade if it becomes empty
authorGreg Ames <gregames@apache.org>
Mon, 1 Oct 2001 21:01:14 +0000 (21:01 +0000)
committerGreg Ames <gregames@apache.org>
Mon, 1 Oct 2001 21:01:14 +0000 (21:01 +0000)
after deleting the EOS bucket.

This prevents a seg fault in mod_include when the connection dies.  There
doesn't seem to be much point in passing empty brigades in general.

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

server/request.c

index d2efdfce2712b78ea8773a0901faec39db44d4c7..11f6f409deaedabda00b1227c02ccfa4199ca566 100644 (file)
@@ -1520,7 +1520,12 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
     if (APR_BUCKET_IS_EOS(e)) {
         apr_bucket_delete(e);
     }
-    return ap_pass_brigade(f->next, bb);
+    if (!APR_BRIGADE_EMPTY(bb)) {
+        return ap_pass_brigade(f->next, bb);
+    }
+    else {
+        return APR_SUCCESS;
+    }
 }