Commit 1087f154 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Send PROXY v2 LOCAL header with probes

Fixes #2151
parent 9837045a
......@@ -92,6 +92,11 @@ static struct lock vbp_mtx;
static pthread_cond_t vbp_cond;
static struct binheap *vbp_heap;
static unsigned char vbp_proxy_local[] = {
0x0d, 0x0a, 0x0d, 0x0a, 0x00, 0x0d, 0x0a, 0x51,
0x55, 0x49, 0x54, 0x0a, 0x20, 0x00, 0x00, 0x00,
};
/*--------------------------------------------------------------------*/
static void
......@@ -300,8 +305,9 @@ vbp_poke(struct vbp_target *vt)
if (vt->backend->proxy_header == 1) {
if (vbp_write_proxy_v1(vt, s) != 0)
return;
} else if (vt->backend->proxy_header == 2)
INCOMPL();
} else if (vt->backend->proxy_header == 2 &&
vbp_write(vt, s, vbp_proxy_local, sizeof vbp_proxy_local) != 0)
return;
/* Send the request */
if (vbp_write(vt, s, vt->req, vt->req_len) != 0)
......
......@@ -21,7 +21,7 @@ varnish v1 -proto PROXY -vcl+backend {
varnish v2 -proto PROXY -vcl {
import std;
probe p {
probe default {
.window = 1;
.threshold = 1;
.interval =0.5s;
......@@ -30,7 +30,6 @@ varnish v2 -proto PROXY -vcl {
.host = "${v1_addr}";
.port = "${v1_port}";
.proxy_header = 1;
.probe = p;
}
backend bp2 {
.host = "${v1_addr}";
......@@ -48,3 +47,4 @@ server s1 -wait
delay 1
varnish v2 -cliexpect "vcl1.bp1[ ]+probe[ ]+Healthy[ ]+1/1" backend.list
varnish v2 -cliexpect "vcl1.bp2[ ]+probe[ ]+Healthy[ ]+1/1" backend.list
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