Beispiel #1
0
void
VRT_purge(const struct sess *sp, double ttl, double grace)
{
	if (sp->cur_method == VCL_MET_HIT)
		HSH_Purge(sp, sp->wrk->obj->objcore->objhead, ttl, grace);
	else if (sp->cur_method == VCL_MET_MISS)
		HSH_Purge(sp, sp->wrk->objcore->objhead, ttl, grace);
}
Beispiel #2
0
void
VRT_purge(const struct vrt_ctx *ctx, double ttl, double grace)
{

	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
	CHECK_OBJ_NOTNULL(ctx->req->wrk, WORKER_MAGIC);
	if (ctx->method == VCL_MET_HIT)
		HSH_Purge(ctx->req->wrk, ctx->req->obj->objcore->objhead,
		    ttl, grace);
	else if (ctx->method == VCL_MET_MISS)
		HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
		    ttl, grace);
}
Beispiel #3
0
void
VRT_purge(VRT_CTX, double ttl, double grace, double keep)
{

	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
	CHECK_OBJ_NOTNULL(ctx->req->wrk, WORKER_MAGIC);
	if (ctx->method == VCL_MET_HIT)
		HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
		    ttl, grace, keep);
	else if (ctx->method == VCL_MET_MISS)
		HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
		    ttl, grace, keep);
}
static enum req_fsm_nxt
cnt_purge(struct worker *wrk, struct req *req)
{
	struct objcore *oc, *boc;
	enum lookup_e lr;

	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
	AZ(req->objcore);

	CHECK_OBJ_NOTNULL(req->vcl, VCL_CONF_MAGIC);

	VRY_Prep(req);

	AZ(req->objcore);
	lr = HSH_Lookup(req, &oc, &boc, 1, 1);
	assert (lr == HSH_MISS);
	AZ(oc);
	CHECK_OBJ_NOTNULL(boc, OBJCORE_MAGIC);
	VRY_Finish(req, DISCARD);

	HSH_Purge(wrk, boc->objhead, 0, 0);

	AZ(HSH_DerefObjCore(&wrk->stats, &boc));

	VCL_purge_method(req->vcl, wrk, req, NULL, req->http->ws);
	req->req_step = R_STP_ERROR;
	return (REQ_FSM_MORE);
}
Beispiel #5
0
static enum req_fsm_nxt
cnt_purge(struct worker *wrk, struct req *req)
{
	struct objcore *oc, *boc;
	enum lookup_e lr;

	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
	AZ(req->objcore);

	AN(req->vcl);

	VRY_Prep(req);

	AZ(req->objcore);
	lr = HSH_Lookup(req, &oc, &boc, 1, 1);
	assert (lr == HSH_MISS);
	AZ(oc);
	CHECK_OBJ_NOTNULL(boc, OBJCORE_MAGIC);
	VRY_Finish(req, DISCARD);

	HSH_Purge(wrk, boc->objhead, 0, 0, 0);

	AZ(HSH_DerefObjCore(wrk, &boc));

	VCL_purge_method(req->vcl, wrk, req, NULL, NULL);
	switch (wrk->handling) {
	case VCL_RET_RESTART:
		req->req_step = R_STP_RESTART;
		break;
	case VCL_RET_SYNTH:
		req->req_step = R_STP_SYNTH;
		break;
	default:
		WRONG("Illegal return from vcl_purge{}");
	}
	return (REQ_FSM_MORE);
}