[master] 6e4099e81 ws: Less magic for the workspace end marker
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Mon Aug 31 18:41:08 UTC 2020
commit 6e4099e81fa91d0c6a2fb8b63594b75351f97e69
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Wed Apr 29 11:39:37 2020 +0200
ws: Less magic for the workspace end marker
diff --git a/bin/varnishd/cache/cache_ws.c b/bin/varnishd/cache/cache_ws.c
index f3847e5c6..a1e511d30 100644
--- a/bin/varnishd/cache/cache_ws.c
+++ b/bin/varnishd/cache/cache_ws.c
@@ -36,6 +36,8 @@
#include <stdio.h>
+#define WS_REDZONE_END '\x15'
+
static const void * const snap_overflowed = &snap_overflowed;
void
@@ -60,7 +62,7 @@ WS_Assert(const struct ws *ws)
assert(ws->r <= ws->e);
assert(PAOK(ws->r));
}
- assert(*ws->e == 0x15);
+ assert(*ws->e == WS_REDZONE_END);
}
int
@@ -105,7 +107,7 @@ WS_Init(struct ws *ws, const char *id, void *space, unsigned len)
assert(PAOK(space));
len = PRNDDN(len - 1);
ws->e = ws->s + len;
- *ws->e = 0x15;
+ *ws->e = WS_REDZONE_END;
ws->f = ws->s;
assert(id[0] & 0x20); // cheesy islower()
bstrcpy(ws->id, id);
More information about the varnish-commit
mailing list