Commit 51ec48a9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Implement incremental freeing of body of private oc's (aka: pass)

during streaming delivery.

This will only happen if the object fills multiple storage segments,
ie: if backend sends using chunked encoding or if the object is
multiple times larger than ${fetch_maxchunksize}.
parent 4f044e15
......@@ -311,6 +311,11 @@ sml_iterator(struct worker *wrk, struct objcore *oc,
sl += st->len;
st = VTAILQ_NEXT(st, list);
if (VTAILQ_NEXT(st, list) != NULL) {
if (final && checkpoint != NULL) {
VTAILQ_REMOVE(&obj->list,
checkpoint, list);
sml_stv_free(stv, checkpoint);
}
checkpoint = st;
checkpoint_len = sl;
}
......@@ -322,7 +327,7 @@ sml_iterator(struct worker *wrk, struct objcore *oc,
st = NULL;
Lck_Unlock(&boc->mtx);
assert(l > 0 || boc->state == BOS_FINISHED);
if (func(priv, st != NULL ? 0 : 1, p, l)) {
if (func(priv, st != NULL ? final : 1, p, l)) {
ret = -1;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment