]> granicus.if.org Git - apache/commitdiff
- In AP_MODE_SPECULATIVE ap_core_input_filter returns APR_SUCCESS and an empty
authorRuediger Pluem <rpluem@apache.org>
Mon, 7 May 2007 14:20:09 +0000 (14:20 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 7 May 2007 14:20:09 +0000 (14:20 +0000)
  brigade in the case that a non blocking read from the socket returned
  APR_EAGAIN. So getting an empty brigade also shows that no data is present
  in the input filter.
  While this reduces the number of false positives for "real data" in the input
  filter the behaviour is not as good as before 533820 because if there are
  only CRLF's in the input filter we do not flush, but we should. To fix this
  it seems that a simulation of AP_MODE_EATCRLF is needed inside of
  check_pipeline.
- Destroy brigade bb at the end of the function.

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

modules/http/http_request.c

index 0238d34119cebd442a9e63b0549040e32b2c95f3..6c967ae1523c41693760db6786b17e9274a160ec 100644 (file)
@@ -194,14 +194,22 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
 static void check_pipeline(conn_rec *c)
 {
     if (c->keepalive != AP_CONN_CLOSE) {
+        apr_status_t rv;
         apr_bucket_brigade *bb = apr_brigade_create(c->pool, c->bucket_alloc);
-        if (ap_get_brigade(c->input_filters, bb, AP_MODE_SPECULATIVE,
-                       APR_NONBLOCK_READ, 1) != APR_SUCCESS) {
-            c->data_in_input_filters = 0;  /* we got APR_EOF or an error */
+
+        rv = ap_get_brigade(c->input_filters, bb, AP_MODE_SPECULATIVE,
+                            APR_NONBLOCK_READ, 1);
+        if (rv != APR_SUCCESS || APR_BRIGADE_EMPTY(bb)) {
+            /*
+             * Error or empty brigade: There is no data present in the input
+             * filter
+             */
+            c->data_in_input_filters = 0;
         }
         else {
             c->data_in_input_filters = 1;
         }
+        apr_brigade_destroy(bb);
     }
 }