From c59fa8d9fd1c290dd14bfafdb89f97dec62dd9d3 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 2 Jul 2002 23:51:21 +0000 Subject: [PATCH] Fix C-L filter non-blocking-mode brokenness. It was failing to ever 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/protocol.c b/server/protocol.c index 59119846e3..3f2dcb6358 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -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) { -- 2.50.1