Commit d4cdfa60 authored by Nils Goroll's avatar Nils Goroll

rename bodyhash -> etag

parent 48173050
......@@ -7,8 +7,8 @@ vmod_LTLIBRARIES = \
libvmod_etag_la_LDFLAGS = $(VMOD_LDFLAGS)
libvmod_etag_la_SOURCES = \
vfp_bodyhash.c \
vfp_bodyhash.h \
vfp_etag.c \
vfp_etag.h \
vmod_etag.c
nodist_libvmod_etag_la_SOURCES = \
......
......@@ -36,9 +36,9 @@
#include "vsha256.h"
#include "miniobj.h"
const struct vfp VFP_bodyhash;
const struct vfp VFP_etag;
struct bodyhash {
struct etag {
unsigned magic;
#define BODYHASH_MAGIC 0xb0d16a56
......@@ -51,14 +51,14 @@ const char placeholder[] = "\"vmod-esiextra magic placeholder " \
const size_t placeholder_l = sizeof(placeholder) - 1;
static enum vfp_status
vfp_bodyhash_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
vfp_etag_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
{
struct bodyhash *bh;
struct etag *bh;
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vfe, VFP_ENTRY_MAGIC);
assert(vfe->vfp == &VFP_bodyhash);
assert(vfe->vfp == &VFP_etag);
assert(placeholder_l == VSHA256_LEN * 2 + 2);
// XXX workspace
......@@ -73,10 +73,10 @@ vfp_bodyhash_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
}
static enum vfp_status
vfp_bodyhash_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
vfp_etag_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
ssize_t *lp)
{
struct bodyhash *bh;
struct etag *bh;
enum vfp_status vp;
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
......@@ -98,9 +98,9 @@ const char hexe[16] = {
// XXX make non-void
static void
vfp_bodyhash_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
vfp_etag_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
{
struct bodyhash *bh;
struct etag *bh;
unsigned char sha[VSHA256_LEN];
const ssize_t hexl = VSHA256_LEN * 2 + 3;
char hex[hexl];
......@@ -132,7 +132,7 @@ vfp_bodyhash_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
// HACKY
p = TRUST_ME(ObjGetAttr(vc->wrk, vc->oc, OA_HEADERS, &l));
if (p == NULL) {
VSLb(vc->wrk->vsl, SLT_Error, "bodyhash: no object");
VSLb(vc->wrk->vsl, SLT_Error, "etag: no object");
goto out;
}
etag = p;
......@@ -152,7 +152,7 @@ vfp_bodyhash_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
} while(1);
if (etag == NULL) {
VSLb(vc->wrk->vsl, SLT_Error, "bodyhash: no placeholder");
VSLb(vc->wrk->vsl, SLT_Error, "etag: no placeholder");
goto out;
}
......@@ -164,9 +164,9 @@ vfp_bodyhash_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
FREE_OBJ(bh);
}
const struct vfp VFP_bodyhash = {
.name = "bodyhash",
.init = vfp_bodyhash_init,
.pull = vfp_bodyhash_pull,
.fini = vfp_bodyhash_fini
const struct vfp VFP_etag = {
.name = "etag",
.init = vfp_etag_init,
.pull = vfp_etag_pull,
.fini = vfp_etag_fini
};
......@@ -25,4 +25,4 @@
*
*/
extern const struct vfp VFP_bodyhash;
extern const struct vfp VFP_etag;
......@@ -4,7 +4,7 @@
#include <cache/cache_filter.h>
#include "vcc_etag_if.h"
#include "vfp_bodyhash.h"
#include "vfp_etag.h"
int
vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
......@@ -12,6 +12,6 @@ vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
if (e != VCL_EVENT_LOAD)
return (0);
VRT_AddVFP(ctx, &VFP_bodyhash);
VRT_AddVFP(ctx, &VFP_etag);
return (0);
}
......@@ -9,7 +9,7 @@ varnish v1 -vcl+backend {
import etag;
sub vcl_backend_response {
set beresp.filters = beresp.filters + " bodyhash";
set beresp.filters = beresp.filters + " etag";
}
sub vcl_deliver {
......
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