~ubuntu-branches/ubuntu/saucy/serf/saucy

« back to all changes in this revision

Viewing changes to buckets/aggregate_buckets.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Samuelson
  • Date: 2010-02-14 23:04:17 UTC
  • mfrom: (1.1.5 upstream) (3.2.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100214230417-t9lz21ifbtu6fhr7
Tags: 0.3.1-1
* New upstream release.
  - patches/libtool: update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
typedef struct {
27
27
    bucket_list_t *list; /* active buckets */
 
28
    bucket_list_t *last; /* last bucket of the list */
28
29
    bucket_list_t *done; /* we finished reading this; now pending a destroy */
29
30
 
30
31
    /* Marks if a snapshot is set. */
90
91
 
91
92
    ctx = serf_bucket_mem_alloc(bucket->allocator, sizeof(*ctx));
92
93
    ctx->list = NULL;
 
94
    ctx->last = NULL;
93
95
    ctx->done = NULL;
94
96
    ctx->snapshot = 0;
95
97
 
133
135
    */
134
136
    if (ctx->list == NULL) {
135
137
        ctx->list = new_list;
 
138
        ctx->last = new_list;
136
139
    }
137
140
    else {
138
 
        bucket_list_t *scan = ctx->list;
139
 
 
140
 
        while (scan->next != NULL)
141
 
            scan = scan->next;
142
 
        scan->next = new_list;
 
141
        ctx->last->next = new_list;
 
142
        ctx->last = ctx->last->next;
143
143
    }
144
144
}
145
145
 
369
369
    apr_status_t status;
370
370
 
371
371
    /* Move all the DONE buckets back in the LIST. */
 
372
    if (! ctx->last && ! ctx->list)
 
373
        ctx->last = ctx->done;
 
374
 
372
375
    while (ctx->done) {
373
376
        next_ctx = ctx->done->next;
374
377
        ctx->done->next = ctx->list;