Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-etag
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-etag
Commits
d4cdfa60
Commit
d4cdfa60
authored
Apr 17, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename bodyhash -> etag
parent
48173050
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
Makefile.am
src/Makefile.am
+2
-2
vfp_etag.c
src/vfp_etag.c
+16
-16
vfp_etag.h
src/vfp_etag.h
+1
-1
vmod_etag.c
src/vmod_etag.c
+2
-2
vmod_etag.vtc
src/vtc/vmod_etag.vtc
+1
-1
No files found.
src/Makefile.am
View file @
d4cdfa60
...
...
@@ -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
=
\
...
...
src/vfp_
bodyhash
.c
→
src/vfp_
etag
.c
View file @
d4cdfa60
...
...
@@ -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
};
src/vfp_
bodyhash
.h
→
src/vfp_
etag
.h
View file @
d4cdfa60
...
...
@@ -25,4 +25,4 @@
*
*/
extern
const
struct
vfp
VFP_
bodyhash
;
extern
const
struct
vfp
VFP_
etag
;
src/vmod_etag.c
View file @
d4cdfa60
...
...
@@ -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
);
}
src/vtc/vmod_etag.vtc
View file @
d4cdfa60
...
...
@@ -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 {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment