[4.1] 6097d7b WS may give us more space than we ask for

Poul-Henning Kamp phk at FreeBSD.org
Fri Sep 4 15:54:53 CEST 2015


commit 6097d7baa5d88ed045df872ee4ba348580a88af3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 10 07:52:41 2015 +0000

    WS may give us more space than we ask for

diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 90965c3..9736ca9 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -364,7 +364,7 @@ vca_make_session(struct worker *wrk, void *arg)
 	vca_tcp_opt_set(sp->fd, 0);
 
 	/* SES_Proto_Sess() must be sceduled with reserved WS */
-	assert(8 == WS_Reserve(sp->ws, 8));
+	assert(8 <= WS_Reserve(sp->ws, 8));
 	wrk->task.func = SES_Proto_Sess;
 	wrk->task.priv = sp;
 }
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 07123fb..9b8d2a5 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -448,7 +448,7 @@ ses_handle(struct waited *wp, enum wait_event ev, double now)
 	case WAITER_ACTION:
 		pp = sp->pool;
 		CHECK_OBJ_NOTNULL(pp, POOL_MAGIC);
-		assert(sizeof *tp == WS_Reserve(sp->ws, sizeof *tp));
+		assert(sizeof *tp <= WS_Reserve(sp->ws, sizeof *tp));
 		tp = (void*)sp->ws->f;
 		tp->func = SES_Proto_Sess;
 		tp->priv = sp;



More information about the varnish-commit mailing list