Commit 610d3cbe authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

I have no idea how I ended up incrementting the fail counter by the

size of the request, probably sleep copy&paste ?

Fixed	#1175
Submitted by:	martin
parent d5c5d5b6
......@@ -67,7 +67,7 @@ sma_alloc(struct stevedore *st, size_t size)
Lck_Lock(&sma_sc->sma_mtx);
sma_sc->stats->c_req++;
if (sma_sc->sma_alloc + size > sma_sc->sma_max) {
sma_sc->stats->c_fail += size;
sma_sc->stats->c_fail++;
size = 0;
} else {
sma_sc->sma_alloc += size;
......
varnishtest "#1175 - -smalloc c_fail incremented by bytes"
server s1 {
rxreq
txresp -nolen -hdr "Content-Length: 1048576"
} -start
varnish v1 -storage "-s test=malloc,1M" -vcl+backend {
sub vcl_fetch {
set beresp.storage = "test";
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 503
} -run
varnish v1 -expect SMA.test.c_fail < 5
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