writev_it_all() in case we have another brigade to process.
Otherwise, nbytes is bogus for the second brigade and
writev_it_all() doesn't know when to quit (it loops).
In writev_it_all(), when compensating for bytes already sent
don't go beyond the number of iovs we were passed on input.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86391
13f79535-47bb-0310-9956-
ffa450edef68
if (bytes_written < len) {
/* Skip over the vectors that have already been written */
apr_size_t cnt = vec[i].iov_len;
- while (n >= cnt) {
+ while (n >= cnt && i + 1 < nvec) {
i++;
cnt += vec[i].iov_len;
}
-
if (n < cnt) {
/* Handle partial write of vec i */
vec[i].iov_base = (char *) vec[i].iov_base +
rv = writev_it_all(r->connection->client->bsock,
vec, nvec,
nbytes, &bytes_sent);
+ nbytes = 0; /* in case more points to another brigade */
}
ap_brigade_destroy(b);