Author: rhuijben
Date: Sat Nov 14 09:58:34 2015
New Revision: 1714298
URL: http://svn.apache.org/viewvc?rev=1714298&view=rev
Log:
Revert the removal of an optimization from the aggregate stream applied in
r1713435, as what this did was safe according to the bucket rules. The to
be aggregated streams should stick to these rules, instead of requiring
something stricter. (This optimization was originally added in r1712806,
so this is 1.4/trunk specific).
Note that the event buckets required this change until r1714297.
* buckets/aggregate_buckets.c
(read_aggregate): Reinstate optimization.
Modified:
serf/trunk/buckets/aggregate_buckets.c
Modified: serf/trunk/buckets/aggregate_buckets.c
URL:
http://svn.apache.org/viewvc/serf/trunk/buckets/aggregate_buckets.c?rev=1714298&r1=1714297&r2=1714298&view=diff
==============================================================================
--- serf/trunk/buckets/aggregate_buckets.c (original)
+++ serf/trunk/buckets/aggregate_buckets.c Sat Nov 14 09:58:34 2015
@@ -265,18 +265,15 @@ static apr_status_t read_aggregate(serf_
* we are asked to perform a read operation - thus ensuring the
* proper read lifetime.
*/
- if (*vecs_used > 0) {
+ if (cur_vecs_used > 0) {
next_list = ctx->list->next;
ctx->list->next = ctx->done;
ctx->done = ctx->list;
ctx->list = next_list;
}
else {
- /* The first bucket didn't add a single byte: we can destroy
- it now. We only do that if we are not already keeping other
- buckets alive. In test_limit_buckets() shows a case where
- an early destroy would not be safe if the bucket is not the
- first one. */
+ /* This bucket didn't add a single byte.
+ We can destroy it directly */
next_list = ctx->list;
ctx->list = next_list->next;
serf_bucket_destroy(next_list->bucket);