[master] 03d9f5df4 Fix WS_ReserveSize calls when bytes is equal to free workspace
Nils Goroll
nils.goroll at uplex.de
Mon Jan 20 12:41:06 UTC 2020
commit 03d9f5df4b5dbe10d4ff775aee384b163581471e
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Mon Dec 16 16:37:27 2019 +0100
Fix WS_ReserveSize calls when bytes is equal to free workspace
Currently, with the 505b7bd9643006fa8e3977f920564ce12a2b24a2 patch, when
calling WS_ReserveSize with bytes equal to the amount of workspace that is
currently available, it will return zero and mark overflow.
This patch redoes the patch, and changes it to return zero and overflow
only when the requested number of bytes is larger than what is available.
diff --git a/bin/varnishd/cache/cache_ws.c b/bin/varnishd/cache/cache_ws.c
index a8208d3a0..61fc5b3fa 100644
--- a/bin/varnishd/cache/cache_ws.c
+++ b/bin/varnishd/cache/cache_ws.c
@@ -262,7 +262,7 @@ WS_ReserveSize(struct ws *ws, unsigned bytes)
if (bytes < b2)
b2 = PRNDUP(bytes);
- if (ws->f + b2 >= ws->e) {
+ if (bytes > b2) {
WS_MarkOverflow(ws);
return (0);
}
More information about the varnish-commit
mailing list