Update to Varnish-Cache 7.5

parent dd88f32c
......@@ -22,7 +22,7 @@ AC_ARG_WITH([rst2man],
[RST2MAN="$withval"],
[AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], [])])
VARNISH_PREREQ([6.0.0])
VARNISH_PREREQ([7.5],[trunk])
VARNISH_VMODS([zipflow])
AC_ARG_VAR([VARNISHSRC], [path to Varnish source])
......
......@@ -139,8 +139,7 @@ get_zipflow_top(VRT_CTX)
return (zft);
}
static int vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv,
struct objcore *oc);
static int vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv);
static int vdp_zipflow_fini(struct vdp_ctx *vdc, void **priv);
static int vdp_zipflow_bytes(struct vdp_ctx *vdc, enum vdp_action act,
void **priv, const void *ptr, ssize_t len);
......@@ -153,8 +152,7 @@ static const struct vdp vdp_zipflow[1] = {{
.priv1 = NULL
}};
static int vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv,
struct objcore *oc);
static int vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv);
static int vdp_zipsub_fini(struct vdp_ctx *vdc, void **priv);
static int vdp_zipsub_bytes(struct vdp_ctx *vdc, enum vdp_action act,
void **priv, const void *ptr, ssize_t len);
......@@ -207,7 +205,11 @@ get_zipflow_request(VRT_CTX)
struct req *req;
req = ctx->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
if (req == NULL) {
VRT_fail(ctx, "zipflow can only be used on the client side");
return (NULL);
}
CHECK_OBJ(req, REQ_MAGIC);
if (req->transport == &ZIPFLOW_transport) {
CAST_OBJ_NOTNULL(zfr, req->transport_priv,
......@@ -502,6 +504,9 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
case VCL_EVENT_WARM:
case VCL_EVENT_COLD:
break;
case VDI_EVENT_SICK:
WRONG("VDI event sent to vmod");
break;
default:
WRONG("illegal event enum");
}
......@@ -611,27 +616,22 @@ zipsub_take(const struct zipflow_request *zfr)
}
static int
vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv)
{
struct zipflow_request *zfr;
struct zipflow_top *zft;
struct req *req;
int r;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
(void) vdc;
AN(vdc);
CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vdc->hp, HTTP_MAGIC);
AN(vdc->clen);
AN(priv);
(void) priv;
CAST_OBJ_NOTNULL(zfr, *priv, ZIPFLOW_REQUEST_MAGIC);
(void) oc;
zft = zipsub_take(zfr);
req = vdc->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
if (req->resp_len == 0)
if (*vdc->clen == 0)
zfr->bundle = 0;
r = 0;
......@@ -648,15 +648,15 @@ vdp_zipsub_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
return (-1);
}
RFC2616_Weaken_Etag(req->resp);
if (req->resp_len != 0)
req->resp_len = -1;
RFC2616_Weaken_Etag(vdc->hp);
if (*vdc->clen != 0)
*vdc->clen = -1;
return (0);
}
static int
vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv)
{
struct zipflow_request *zfr = get_zipflow_request(ctx);
struct zipflow_top *zft;
......@@ -664,17 +664,21 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
if (zfr == NULL)
return (1);
CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vdc->hp, HTTP_MAGIC);
AN(vdc->clen);
zft = zfr->top;
CHECK_OBJ_NOTNULL(zft, ZIPFLOW_TOP_MAGIC);
CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vdc->req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); // get_zipflow_request() guarantees
if (zft->req) {
if (zft->req != NULL) {
VSLb(vdc->vsl, SLT_Error, "zipflow: can't be nested");
return (-1);
}
if (vdc->req->resp_len == 0) {
if (*vdc->clen == 0) {
VSLb(vdc->vsl, SLT_Error, "zipflow: need body bytes");
return (-1);
}
......@@ -693,7 +697,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
}
AZ(zft->req);
zft->req = vdc->req;
zft->req = ctx->req;
AZ(zft->zip);
zft->zip = zip_pipe(vdc, vdp_zipflow_put, zfr->level);
if (zft->zip == NULL) {
......@@ -706,7 +710,7 @@ vdp_zipflow_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
AZ(*priv);
*priv = zfr;
return (vdp_zipsub_init(ctx, vdc, priv, oc));
return (vdp_zipsub_init(ctx, vdc, priv));
}
static void
......
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