PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) core: Optimize send_brigade_nonblocking()
- trunk patch:
- https://svn.apache.org/r1892450
- https://svn.apache.org/r1909966
- 2.4.x patch: svn merge -c 1892450,1909966 ^/httpd/httpd/trunk .
- +1: jailletc36, rpluem, icing
-
*) mod_deflate: Add DeflateAlterETag to control how the ETag
is modified. The 'NoChange' parameter mimics 2.2.x behavior.
PR 45023, PR 39727.
if (!nvec) {
apr_bucket_delete(bucket);
}
- continue;
}
-
- /* Make sure that these new data fit in our iovec. */
- if (nvec == ctx->nvec) {
- if (nvec == NVEC_MAX) {
- sock_nopush(s, 1);
- rv = writev_nonblocking(s, bb, ctx, nbytes, nvec, c);
- if (rv != APR_SUCCESS) {
- goto cleanup;
- }
- nbytes = 0;
- nvec = 0;
- }
- else {
- struct iovec *newvec;
- apr_size_t newn = nvec * 2;
- if (newn < NVEC_MIN) {
- newn = NVEC_MIN;
- }
- else if (newn > NVEC_MAX) {
- newn = NVEC_MAX;
+ else {
+ /* Make sure that these new data fit in our iovec. */
+ if (nvec == ctx->nvec) {
+ if (nvec == NVEC_MAX) {
+ sock_nopush(s, 1);
+ rv = writev_nonblocking(s, bb, ctx, nbytes, nvec, c);
+ if (rv != APR_SUCCESS) {
+ goto cleanup;
+ }
+ nbytes = 0;
+ nvec = 0;
}
- newvec = apr_palloc(c->pool, newn * sizeof(struct iovec));
- if (nvec) {
- memcpy(newvec, ctx->vec, nvec * sizeof(struct iovec));
+ else {
+ struct iovec *newvec;
+ apr_size_t newn = nvec * 2;
+ if (newn < NVEC_MIN) {
+ newn = NVEC_MIN;
+ }
+ else if (newn > NVEC_MAX) {
+ newn = NVEC_MAX;
+ }
+ newvec = apr_palloc(c->pool, newn * sizeof(struct iovec));
+ if (nvec) {
+ memcpy(newvec, ctx->vec, nvec * sizeof(struct iovec));
+ }
+ ctx->vec = newvec;
+ ctx->nvec = newn;
}
- ctx->vec = newvec;
- ctx->nvec = newn;
}
+ nbytes += length;
+ ctx->vec[nvec].iov_base = (void *)data;
+ ctx->vec[nvec].iov_len = length;
+ nvec++;
}
- nbytes += length;
- ctx->vec[nvec].iov_base = (void *)data;
- ctx->vec[nvec].iov_len = length;
- nvec++;
/* Flush above max threshold, unless the brigade still contains in
* memory buckets which we want to try writing in the same pass (if
*/
if (nbytes > conf->flush_max_threshold
&& next != APR_BRIGADE_SENTINEL(bb)
- && !is_in_memory_bucket(next)) {
+ && next->length && !is_in_memory_bucket(next)) {
sock_nopush(s, 1);
rv = writev_nonblocking(s, bb, ctx, nbytes, nvec, c);
if (rv != APR_SUCCESS) {