]> granicus.if.org Git - apache/commitdiff
Initialize nbytes across each iteration and not just after a call to writev_it_all.
authorBill Stoddard <stoddard@apache.org>
Mon, 9 Oct 2000 18:02:45 +0000 (18:02 +0000)
committerBill Stoddard <stoddard@apache.org>
Mon, 9 Oct 2000 18:02:45 +0000 (18:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86479 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_core.c

index 3d6f58e15383a650ab0f269638d1f606e67df603..8ecf2a1dc55037ec74e77dcb89e38dda3ffaae44 100644 (file)
@@ -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);