Move assertion to the right place

When we work on the last segment, the remaining length is zero,
but we still have a current pointer and length.

This was a particularly annoying glitch because I wrote almost
the same code for varnish-cache with the equivalent assertion in
the right place :(

Sorry

Ref https://github.com/varnishcache/varnish-cache/pull/4013/commits/8ec77190d91603c8f0dead0cee013e3c9ca8fa78#diff-f79cfeda8456789ae873270aefa58e8f1e94213ee16d32ea96b8db8a7013ebf8R790
Closes #34
parent cab6dd10
......@@ -919,10 +919,10 @@ sfemem_getspace(struct worker *wrk, struct objcore *oc, ssize_t *ssz,
if (hack != NULL && (hack->boc == NULL || hack->boc == boc)) {
CHECK_OBJ(hack, VC4013_MAGIC);
hack->boc = boc;
AN(hack->l);
fcr.status = fcr_ok;
if (hack->pl == 0) {
hack->p = NULL;
AN(hack->l);
hack->pl = hack->l;
fcr = fellow_busy_obj_getspace(sfe_fbo(oc),
&hack->pl, &hack->p);
......
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