httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1239122 - /httpd/httpd/branches/2.4.x/server/core_filters.c
Date Wed, 01 Feb 2012 13:28:00 GMT
Author: jim
Date: Wed Feb  1 13:27:59 2012
New Revision: 1239122

URL: http://svn.apache.org/viewvc?rev=1239122&view=rev
Log:
Merge r1233882 from trunk:

* 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.

Submitted by: jorton
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/server/core_filters.c

Modified: httpd/httpd/branches/2.4.x/server/core_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/core_filters.c?rev=1239122&r1=1239121&r2=1239122&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/core_filters.c (original)
+++ httpd/httpd/branches/2.4.x/server/core_filters.c Wed Feb  1 13:27:59 2012
@@ -142,7 +142,7 @@ int ap_core_input_filter(ap_filter_t *f,
          * 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;
@@ -228,7 +228,9 @@ int ap_core_input_filter(ap_filter_t *f,
         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) {



Mime
View raw message