Commit a9e5d350 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Increase the id field in VSM to 128 bytes to make space for

64 backend VCL name + IPv4, IPv6 and portnumber.

Fixes	#1144
parent 5011af25
varnishtest "very long backend names"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
backend fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
{
.host = "127.0.0.1";
.port = "54321";
}
sub vcl_recv {
if (req.url == "never") {
set req.backend = fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210;
}
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
} -run
varnish v1 -badvcl {
backend 0fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
{
.host = "127.0.0.1";
.port = "54321";
}
sub vcl_recv {
if (req.url == "never") {
set req.backend = fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210;
}
}
}
......@@ -104,7 +104,7 @@ struct VSM_chunk {
ssize_t next; /* Offset in shmem */
char class[8];
char type[8];
char ident[64];
char ident[128];
};
struct VSM_head {
......
......@@ -706,6 +706,13 @@ vcc_ParseDirector(struct vcc *tl)
vcc_ExpectCid(tl); /* ID: name */
ERRCHK(tl);
if (tl->t->e - tl->t->b > 64) {
VSB_printf(tl->sb,
"Name of %.*s too long (max 64, is %zd):\n",
PF(t_first), (tl->t->e - tl->t->b));
vcc_ErrWhere(tl, tl->t);
return;
}
tl->t_dir = tl->t;
vcc_NextToken(tl);
......
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