Skip to content

Commit

Permalink
Extend vrt_backend with a connection prefix ptr+len
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Oct 8, 2019
1 parent ec70dbc commit bba1499
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bin/varnishd/cache/cache_backend.c
Expand Up @@ -541,6 +541,8 @@ vrt_hash_be(const struct vrt_backend *vrt)
VSHA256_Update(cx, vrt->ipv6_suckaddr, vsa_suckaddr_len);
if (vrt->path != NULL)
VSHA256_Update(cx, vrt->path, strlen(vrt->path));
if (vrt->prefix_ptr != NULL)
VSHA256_Update(cx, vrt->prefix_ptr, vrt->prefix_len);
VSHA256_Final(ident, cx);
return (vbe64dec(ident));
}
Expand Down
8 changes: 5 additions & 3 deletions include/vrt.h
Expand Up @@ -52,7 +52,7 @@
* binary/load-time compatible, increment MAJOR version
*
* unreleased (planned for 2020-03-15)
* (nothing yet)
* New prefix_{ptr|len} fields in vrt_backend
* 10.0 (2019-09-15)
* VRT_UpperLowerStrands added.
* VRT_synth_page now takes STRANDS argument
Expand Down Expand Up @@ -344,7 +344,9 @@ extern const void * const vrt_magic_string_unset;
vtim_dur first_byte_timeout; \
vtim_dur between_bytes_timeout; \
unsigned max_connections; \
unsigned proxy_header;
unsigned proxy_header; \
void *prefix_ptr; \
unsigned prefix_len;

#define VRT_BACKEND_HANDLE() \
do { \
Expand All @@ -363,7 +365,7 @@ extern const void * const vrt_magic_string_unset;

struct vrt_backend {
unsigned magic;
#define VRT_BACKEND_MAGIC 0x4799ce6b
#define VRT_BACKEND_MAGIC 0x4799ce6c
VRT_BACKEND_FIELDS(const)
VCL_IP ipv4_suckaddr;
VCL_IP ipv6_suckaddr;
Expand Down

0 comments on commit bba1499

Please sign in to comment.