Commit d54e1ec9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Pass a busyobj * to the VCL methods

parent 765139fa
......@@ -191,7 +191,7 @@ VCL_Load(const char *fn, const char *name, struct cli *cli)
REPLACE(vcl->name, name);
VCLI_Out(cli, "Loaded \"%s\" as \"%s\"", fn , name);
VTAILQ_INSERT_TAIL(&vcl_head, vcl, list);
(void)vcl->conf->init_func(NULL, NULL, NULL);
(void)vcl->conf->init_func(NULL, NULL, NULL, NULL);
Lck_Lock(&vcl_mtx);
if (vcl_active == NULL)
vcl_active = vcl;
......@@ -215,7 +215,7 @@ VCL_Nuke(struct vcls *vcl)
assert(vcl->conf->discard);
assert(vcl->conf->busy == 0);
VTAILQ_REMOVE(&vcl_head, vcl, list);
(void)vcl->conf->fini_func(NULL, NULL, NULL);
(void)vcl->conf->fini_func(NULL, NULL, NULL, NULL);
vcl->conf->fini_vcl(NULL);
free(vcl->name);
(void)dlclose(vcl->dlh);
......@@ -340,20 +340,21 @@ VCL_##func##_method(struct worker *wrk, struct req *req, struct ws *ws) \
{ \
char *aws; \
\
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); \
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); \
CHECK_OBJ_NOTNULL(req->sp, SESS_MAGIC); \
AN(req->sp); \
aws = WS_Snapshot(req->wrk->aws); \
aws = WS_Snapshot(wrk->aws); \
req->handling = 0; \
req->cur_method = VCL_MET_ ## upper; \
VSLb(req->vsl, SLT_VCL_call, "%s", #func); \
(void)req->vcl->func##_func(wrk, req, ws); \
(void)req->vcl->func##_func(wrk, req, NULL, ws); \
VSLb(req->vsl, SLT_VCL_return, "%s", \
VCL_Return_Name(req->handling)); \
req->cur_method = 0; \
assert((1U << req->handling) & bitmap); \
assert(!((1U << req->handling) & ~bitmap)); \
WS_Reset(req->wrk->aws, aws); \
WS_Reset(wrk->aws, aws); \
}
#include "tbl/vcl_returns.h"
......
......@@ -745,13 +745,15 @@ file_header(fo)
fo.write("""
struct sess;
struct req;
struct busyobj;
struct ws;
struct cli;
struct worker;
typedef int vcl_init_f(struct cli *);
typedef void vcl_fini_f(struct cli *);
typedef int vcl_func_f(struct worker *, struct req *, struct ws *);
typedef int vcl_func_f(struct worker *, struct req *, struct busyobj *,
struct ws *);
""")
......
......@@ -694,7 +694,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
Fc(tl, 1, "\nstatic int __match_proto__(vcl_func_f)\n");
Fc(tl, 1,
"VGC_function_%s(struct worker *wrk,"
" struct req *req, struct ws *ws)\n",
" struct req *req, struct busyobj *bo, struct ws *ws)\n",
method_tab[i].name);
AZ(VSB_finish(tl->fm[i]));
Fc(tl, 1, "{\n");
......
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