From c7e0518730cfbd3c33d3634d9a35e902af559993 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 20 Jan 2012 12:41:18 +0000 Subject: [PATCH] * server/core_filters.c (ap_core_input_filter): Only treat EAGAIN as 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/core_filters.c b/server/core_filters.c index 686513fe6e7..5cdcb990d09 100644 --- a/server/core_filters.c +++ b/server/core_filters.c @@ -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) { -- 2.47.3