From 818f94113f777dedb3b48ca71d7dcce042602d6d Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 9 Oct 2000 18:02:45 +0000 Subject: [PATCH] Initialize nbytes across each iteration and not just after a call to writev_it_all. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86479 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 3d6f58e153..8ecf2a1dc5 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -3322,7 +3322,7 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b) { apr_status_t rv; ap_bucket_brigade *more = NULL; - apr_ssize_t bytes_sent = 0, nbytes = 0; + apr_ssize_t bytes_sent = 0, nbytes; ap_bucket *e; conn_rec *c = f->c; @@ -3352,6 +3352,7 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b) /* Iterate over the brigade collecting iovecs */ while (b) { + nbytes = 0; /* in case more points to another brigade */ more = NULL; AP_BRIGADE_FOREACH(e, b) { if (e->type == AP_BUCKET_EOS) { @@ -3447,7 +3448,6 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b) rv = writev_it_all(c->client->bsock, vec, nvec, nbytes, &bytes_sent); - nbytes = 0; /* in case more points to another brigade */ } ap_brigade_destroy(b); -- 2.50.1