Commit 23333e3c authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Pål Hermunn Johansen

Remove irrelevant limits that were caused by VSC

Closes #2406
Refs #2157
parent 97c02d22
......@@ -143,11 +143,11 @@ stv_check_ident(const char *spec, const char *ident)
void
STV_Config(const char *spec)
{
char **av;
char **av, buf[8];
const char *name;
struct stevedore *stv;
const struct stevedore *stv2;
int ac, l;
int ac;
static unsigned seq = 0;
av = MGT_NamedArg(spec, &name, "-s");
......@@ -174,16 +174,13 @@ STV_Config(const char *spec)
*stv = *stv2;
AN(stv->name);
if (name == NULL)
bprintf(stv->ident, "s%u", seq++);
else {
/* XXX: no need for truncation once VSM ident becomes dynamic */
l = strlen(name);
if (l > sizeof stv->ident - 1)
l = sizeof stv->ident - 1;
bprintf(stv->ident, "%.*s", l, name);
if (name == NULL) {
bprintf(buf, "s%u", seq++);
name = buf;
}
stv->ident = strdup(name);
AN(stv->ident);
stv_check_ident(spec, stv->ident);
if (stv->init != NULL)
......
......@@ -119,7 +119,7 @@ struct stevedore {
void *priv;
VTAILQ_ENTRY(stevedore) list;
char ident[16]; /* XXX: match VSM_chunk.ident */
char *ident;
char *vclname;
};
......
varnishtest "Long backend and storage names"
varnish v1 -arg "-s acme_example_com_static_assets_malloc_storage=malloc"
varnish v1 -vcl {
backend be_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789 {
.host = "${bad_backend}";
}
} -start
varnish v1 -expect SMA.acme_example_com_static_assets_malloc_storage.c_req == 0
varnish v1 -expect VBE.vcl1.be_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789.req == 0
......@@ -469,16 +469,6 @@ vcc_ParseBackend(struct vcc *tl)
vcc_ExpectVid(tl, "backend"); /* ID: name */
ERRCHK(tl);
/* XXX: lift this limit once VSM ident becomes dynamic */
if (tl->t->e - tl->t->b > MAX_BACKEND_NAME) {
VSB_printf(tl->sb,
"Name of %.*s too long (max %d, is %zu):\n",
PF(t_first), MAX_BACKEND_NAME,
(size_t)(tl->t->e - tl->t->b));
vcc_ErrWhere(tl, tl->t);
return;
}
t_be = tl->t;
vcc_NextToken(tl);
......
......@@ -234,7 +234,6 @@ void vcc_Acl_Hack(struct vcc *tl, char *b, size_t bl);
int vcc_ParseAction(struct vcc *tl);
/* vcc_backend.c */
#define MAX_BACKEND_NAME 64
struct fld_spec;
void vcc_ParseProbe(struct vcc *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