Commit 9cfe535f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

If we fail to allocate an object, attempt to create a shortlived

object in Transient storage and if that also fails, 503.

Fixes 879
parent 6e493502
......@@ -689,7 +689,22 @@ cnt_fetchbody(struct sess *sp)
sp->obj = STV_NewObject(sp, sp->wrk->storage_hint, l,
&sp->wrk->exp, nhttp);
/* XXX: -> 513 */
if (sp->obj == NULL) {
/*
* Try to salvage the transaction by allocating a
* shortlived object on Transient storage.
*/
sp->obj = STV_NewObject(sp, TRANSIENT_STORAGE, l,
&sp->wrk->exp, nhttp);
sp->wrk->exp.ttl = params->shortlived;
}
if (sp->obj == NULL) {
HSH_Drop(sp);
sp->err_code = 503;
sp->step = STP_ERROR;
VDI_CloseFd(sp);
return (0);
}
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
sp->wrk->storage_hint = NULL;
......
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