]> granicus.if.org Git - apache/commitdiff
Fix C-L filter non-blocking-mode brokenness. It was failing to ever
authorCliff Woolley <jwoolley@apache.org>
Tue, 2 Jul 2002 23:51:21 +0000 (23:51 +0000)
committerCliff Woolley <jwoolley@apache.org>
Tue, 2 Jul 2002 23:51:21 +0000 (23:51 +0000)
read from pipe/socket buckets again if it got APR_EAGAIN from them
due to its use of APR_BRIGADE_FOREACH.

Submitted by: the gang on IRC

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

server/protocol.c

index 59119846e306d83be2a022da0e64f9f466b90599..3f2dcb63582f77f77001c17dfaaca79e14c6e3a8 100644 (file)
@@ -1199,12 +1199,14 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
         split = NULL;
         flush = 0;
 
-        APR_BRIGADE_FOREACH(e, b) {
+        e = APR_BRIGADE_FIRST(b);
+        while (e != APR_BRIGADE_SENTINEL(b)) {
             const char *ignored;
             apr_size_t len;
             len = 0;
             if (APR_BUCKET_IS_EOS(e)) {
                 eos = 1;
+                break;
             }
             else if (APR_BUCKET_IS_FLUSH(e)) {
                 if (partial_send_okay) {
@@ -1241,6 +1243,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
                         flush = 1;
                         break;
                     }
+                    continue;
                 }
                 else if (rv != APR_EOF) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
@@ -1255,6 +1258,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
 
             ctx->curr_len += len;
             r->bytes_sent += len;
+            e = APR_BUCKET_NEXT(e);
         }
 
         if (split) {