Commit 2f991e16 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Require all storage to be at least 1M

It does not make sense to specify less that 1M of storage, so error
out if a user specifies -smalloc,512 for instance.  They probably
meant -smalloc,512M, but require them to be explicit.

Adjust C00027 test case to match
parent cc8a1733
......@@ -201,6 +201,10 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
if (q != NULL)
ARGV_ERR("(%s) size \"%s\": %s\n", size, ctx, q);
if (l < 1024*1024)
ARGV_ERR("(-spersistent) size \"%s\": too small, "
"did you forget to specify M or G?\n", size);
}
/*
......
......@@ -187,6 +187,9 @@ sma_init(struct stevedore *parent, int ac, char * const *av)
ARGV_ERR("(-smalloc) size \"%s\": %s\n", av[0], e);
if ((u != (uintmax_t)(size_t)u))
ARGV_ERR("(-smalloc) size \"%s\": too big\n", av[0]);
if (u < 1024*1024)
ARGV_ERR("(-smalloc) size \"%s\": too small, "
"did you forget to specify M or G?\n", av[0]);
printf("SMA.%s: max size %ju MB.\n", parent->ident,
u / (1024 * 1024));
......
......@@ -18,7 +18,7 @@ server s1 {
txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
} -start
varnish v1 -arg "-s malloc,40k" -vcl+backend {
varnish v1 -arg "-s malloc,1M" -vcl+backend {
sub vcl_fetch {
set beresp.ttl = 10m;
}
......
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