Description: Make serf_bucket_aggregate_prepend() behave properly when prepending a bucket to an empty list
Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1712790

Index: serf/buckets/aggregate_buckets.c
===================================================================
--- serf.orig/buckets/aggregate_buckets.c
+++ serf/buckets/aggregate_buckets.c
@@ -154,6 +154,8 @@ void serf_bucket_aggregate_prepend(
     new_list->bucket = prepend_bucket;
     new_list->next = ctx->list;
 
+    if (ctx->list == NULL)
+        ctx->last = new_list;
     ctx->list = new_list;
 }
 
@@ -283,6 +285,8 @@ static apr_status_t read_aggregate(serf_
 
             /* If we have no more in our list, return EOF. */
             if (!ctx->list) {
+                ctx->last = NULL;
+
                 if (ctx->hold_open) {
                     return ctx->hold_open(ctx->hold_open_baton, bucket);
                 }
@@ -395,6 +399,8 @@ static apr_status_t serf_aggregate_readl
 
             /* If we have no more in our list, return EOF. */
             if (!ctx->list) {
+                ctx->last = NULL;
+
                 if (ctx->hold_open) {
                     return ctx->hold_open(ctx->hold_open_baton, bucket);
                 }
