Commit 6318870a authored by Julian Wiesener's avatar Julian Wiesener

Update -> v4.0-release

parent 3c513dec
...@@ -9,7 +9,7 @@ AM_LDFLAGS = $(AM_LT_LDFLAGS) ...@@ -9,7 +9,7 @@ AM_LDFLAGS = $(AM_LT_LDFLAGS)
vmoddir = $(VMODDIR) vmoddir = $(VMODDIR)
vmod_LTLIBRARIES = libvmod_vslp.la vmod_LTLIBRARIES = libvmod_vslp.la
vmod_srcdir = $(top_srcdir)/src vmod_srcdir = $(top_srcdir)/src
vmodtool = $(VARNISHSRC)/lib/libvcl/vmodtool.py vmodtool = $(VARNISHSRC)/lib/libvcc/vmodtool.py
libvmod_vslp_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -shared libvmod_vslp_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -shared
......
...@@ -60,7 +60,7 @@ vmod_vslp__init(const struct vrt_ctx *ctx, struct vmod_vslp_vslp **vslpdp, const ...@@ -60,7 +60,7 @@ vmod_vslp__init(const struct vrt_ctx *ctx, struct vmod_vslp_vslp **vslpdp, const
AN(vslpd); AN(vslpd);
*vslpdp = vslpd; *vslpdp = vslpd;
vslpdir_new(&vslpd->vslpd, vcl_name, vslpd); vslpdir_new(&vslpd->vslpd, vcl_name);
} }
VCL_VOID __match_proto__(td_vslp_vslp__fini) VCL_VOID __match_proto__(td_vslp_vslp__fini)
......
...@@ -26,16 +26,15 @@ ...@@ -26,16 +26,15 @@
# SUCH DAMAGE. # SUCH DAMAGE.
Module vslp $Module vslp 3
Object vslp() { $Object vslp()
Method VOID .add_backend(BACKEND) $Method VOID .add_backend(BACKEND)
Method VOID .set_rampup_ratio(REAL) $Method VOID .set_rampup_ratio(REAL)
Method VOID .set_rampup_time(DURATION) $Method VOID .set_rampup_time(DURATION)
Method VOID .set_hash(ENUM { CRC32, SHA256, RS }) $Method VOID .set_hash(ENUM { CRC32, SHA256, RS })
Method VOID .init_hashcircle(INT) $Method VOID .init_hashcircle(INT)
Method BACKEND .backend() $Method BACKEND .backend()
Method BACKEND .backend_by_int(INT) $Method BACKEND .backend_by_int(INT)
Method BACKEND .backend_by_string(STRING) $Method BACKEND .backend_by_string(STRING)
Method BACKEND .backend_by_string_hash(STRING, ENUM { CRC32, SHA256, RS }) $Method BACKEND .backend_by_string_hash(STRING, ENUM { CRC32, SHA256, RS })
}
...@@ -189,7 +189,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry) ...@@ -189,7 +189,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
be = state->vslpd->backend[chosen]; be = state->vslpd->backend[chosen];
AN(be); AN(be);
if(be->healthy(be, state->ctx->bo->digest)) if(be->healthy(be, NULL))
{ {
vslp_be_healthy(state, chosen); vslp_be_healthy(state, chosen);
break; break;
...@@ -202,7 +202,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry) ...@@ -202,7 +202,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
} }
void void
vslpdir_new(struct vslpdir **vslpdp, const char *vcl_name, void *priv) vslpdir_new(struct vslpdir **vslpdp, const char *vcl_name)
{ {
struct vslpdir *vslpd; struct vslpdir *vslpd;
...@@ -369,7 +369,7 @@ void vslpdir_expand(struct vslpdir *vslpd, unsigned n) ...@@ -369,7 +369,7 @@ void vslpdir_expand(struct vslpdir *vslpd, unsigned n)
} }
unsigned unsigned
vslpdir_any_healthy(struct vslpdir *vslpd, const uint8_t *digest) vslpdir_any_healthy(struct vslpdir *vslpd)
{ {
unsigned retval = 0; unsigned retval = 0;
VCL_BACKEND be; VCL_BACKEND be;
...@@ -380,7 +380,7 @@ vslpdir_any_healthy(struct vslpdir *vslpd, const uint8_t *digest) ...@@ -380,7 +380,7 @@ vslpdir_any_healthy(struct vslpdir *vslpd, const uint8_t *digest)
for (u = 0; u < vslpd->n_backend; u++) { for (u = 0; u < vslpd->n_backend; u++) {
be = vslpd->backend[u]; be = vslpd->backend[u];
CHECK_OBJ_NOTNULL(be, DIRECTOR_MAGIC); CHECK_OBJ_NOTNULL(be, DIRECTOR_MAGIC);
if (be->healthy(be, digest)) { if (be->healthy(be, NULL)) {
retval = 1; retval = 1;
break; break;
} }
...@@ -438,7 +438,7 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd, const struct vrt_ctx *ctx, ui ...@@ -438,7 +438,7 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd, const struct vrt_ctx *ctx, ui
be = vslpd->backend[chosen]; be = vslpd->backend[chosen];
AN(be); AN(be);
if (be->healthy(be, ctx->bo->digest)) if (be->healthy(be, NULL))
{ {
if(!vslp_be_healthy(&state, chosen)) if(!vslp_be_healthy(&state, chosen))
be_choice ^= be_choice; be_choice ^= be_choice;
......
...@@ -61,7 +61,7 @@ struct vslpdir { ...@@ -61,7 +61,7 @@ struct vslpdir {
VCL_INT replicas; VCL_INT replicas;
}; };
void vslpdir_new(struct vslpdir **vslpdp, const char *vcl_name, void *priv); void vslpdir_new(struct vslpdir **vslpdp, const char *vcl_name);
void vslpdir_delete(struct vslpdir **vslpdp); void vslpdir_delete(struct vslpdir **vslpdp);
void vslpdir_add_backend(struct vslpdir *vslpd, VCL_BACKEND be); void vslpdir_add_backend(struct vslpdir *vslpd, VCL_BACKEND be);
void vslpdir_set_rampup_ratio(struct vslpdir *vslpd, VCL_REAL ratio); void vslpdir_set_rampup_ratio(struct vslpdir *vslpd, VCL_REAL ratio);
...@@ -71,5 +71,5 @@ void vslpdir_init_hashcircle(struct vslpdir *vslpd, VCL_INT replicas); ...@@ -71,5 +71,5 @@ void vslpdir_init_hashcircle(struct vslpdir *vslpd, VCL_INT replicas);
void vslpdir_lock(struct vslpdir *vslpd); void vslpdir_lock(struct vslpdir *vslpd);
void vslpdir_unlock(struct vslpdir *vslpd); void vslpdir_unlock(struct vslpdir *vslpd);
void vslpdir_expand(struct vslpdir *vslpd, unsigned n); void vslpdir_expand(struct vslpdir *vslpd, unsigned n);
unsigned vslpdir_any_healthy(struct vslpdir *vslpd, const uint8_t *digest); unsigned vslpdir_any_healthy(struct vslpdir *vslpd);
VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd, const struct vrt_ctx *ctx, uint32_t hash); VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd, const struct vrt_ctx *ctx, uint32_t hash);
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