Commit bdc32c9e authored by Nils Goroll's avatar Nils Goroll

VRT_selecthttp now in the api

parent b0154f02
Pipeline #18 skipped
......@@ -32,34 +32,6 @@
#include "vtstor.h"
/*
* VRT_selecthttp is not public in Varnish <= 4.0.3.
*/
static struct http *
selecthttp(VRT_CTX, enum gethdr_e where)
{
struct http *hp;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
switch (where) {
case HDR_REQ:
hp = ctx->http_req;
break;
case HDR_BEREQ:
hp = ctx->http_bereq;
break;
case HDR_BERESP:
hp = ctx->http_beresp;
break;
case HDR_RESP:
hp = ctx->http_resp;
break;
default:
WRONG("selecthttp 'where' invalid");
}
return (hp);
}
VCL_VOID __match_proto__(td_vmod_vtstor__init)
vmod_vtstor__init(VRT_CTX, struct vmod_vtstor_vtstor **vmip,
const char *vcl_name, VCL_INT nbuckets,
......@@ -120,7 +92,7 @@ vmod_vtstor_store(VRT_CTX, struct vmod_vtstor_vtstor *vmi,
return;
}
hp = selecthttp(ctx, hdr->where);
hp = VRT_selecthttp(ctx, hdr->where);
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
unsigned u, l = hdr->what[0];
......@@ -140,7 +112,7 @@ vmod_vtstor_get(VRT_CTX, struct vmod_vtstor_vtstor *vmi, VCL_HEADER hdr)
AN(hdr);
AN(hdr->what);
hp = selecthttp(ctx, hdr->where);
hp = VRT_selecthttp(ctx, hdr->where);
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
unsigned u, l = hdr->what[0];
......@@ -161,7 +133,7 @@ vmod_vtstor_delete(VRT_CTX, struct vmod_vtstor_vtstor *vmi, VCL_HEADER hdr)
AN(hdr);
AN(hdr->what);
hp = selecthttp(ctx, hdr->where);
hp = VRT_selecthttp(ctx, hdr->where);
CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
unsigned u, l = hdr->what[0];
......
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