Commit cd761af1 authored by Nils Goroll's avatar Nils Goroll

fix an off-by one error: failing assertion if only one backend configured

parent c875e2d0
varnishtest "VSLP - single backend works"
server s1 {
rxreq
txresp -body "ech3Ooj"
} -start
varnish v1 -vcl+backend {
import vslp from "${vmod_topbuild}/src/.libs/libvmod_vslp.so" ;
sub vcl_init {
new vd = vslp.vslp();
vd.add_backend(s1);
vd.set_rampup_ratio(0);
vd.init_hashcircle(25);
}
sub vcl_recv {
set req.backend_hint = vd.backend();
return(pass);
}
} -start
client c1 {
txreq -url /eishoSu2
rxresp
expect resp.body == "ech3Ooj"
} -run
......@@ -304,7 +304,7 @@ vslpdir_init_hashcircle(struct vslpdir *vslpd, VCL_INT replicas)
sizeof(struct vslp_hostnode));
AN(vslpd->hashcircle);
AN(vslpd->backend);
if(vslpd->backend[1] == NULL)
if(vslpd->backend[0] == NULL)
{
vslpdir_unlock(vslpd);
WRONG("VSLP director doesn't have any backends");
......
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