]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* server/core_filters.c (ap_core_input_filter): Only treat EAGAIN as
authorJoe Orton <jorton@apache.org>
Fri, 20 Jan 2012 12:41:18 +0000 (12:41 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 20 Jan 2012 12:41:18 +0000 (12:41 +0000)
  success if a non-blocking read was requested; for a blocking read,
  it is an error condition.

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

server/core_filters.c

index 686513fe6e7b16a2ae19b01f37a936d590645248..5cdcb990d0937c72adf286b8c63fb80a91cce3b0 100644 (file)
@@ -137,7 +137,7 @@ int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
          * empty).  We do this by returning whatever we have read.  This may
          * or may not be bogus, but is consistent (for now) with EOF logic.
          */
-        if (APR_STATUS_IS_EAGAIN(rv)) {
+        if (APR_STATUS_IS_EAGAIN(rv) && block == APR_NONBLOCK_READ) {
             rv = APR_SUCCESS;
         }
         return rv;
@@ -223,7 +223,9 @@ int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
         e = APR_BRIGADE_FIRST(ctx->b);
         rv = apr_bucket_read(e, &str, &len, block);
 
-        if (APR_STATUS_IS_EAGAIN(rv)) {
+        if (APR_STATUS_IS_EAGAIN(rv) && block == APR_NONBLOCK_READ) {
+            /* getting EAGAIN for a blocking read is an error; for a
+             * non-blocking read, return an empty brigade. */
             return APR_SUCCESS;
         }
         else if (rv != APR_SUCCESS) {