[master] dff71c6 Transaction limit 0 doesn't make any sense, enforce -L > 0
Martin Blix Grydeland
martin at varnish-software.com
Wed Apr 22 11:09:09 CEST 2015
commit dff71c6c8f65927ff1b56e6ff645f68747351e12
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Wed Apr 22 11:03:41 2015 +0200
Transaction limit 0 doesn't make any sense, enforce -L > 0
Also do not assert on empty incomplete list even though VTX count is
larger than L. This can happen when a complete multi-transaction
result is still unreported.
Original patch by Geoff Simmons (Uplex)
diff --git a/lib/libvarnishapi/vsl_arg.c b/lib/libvarnishapi/vsl_arg.c
index 24483c9..e6b2b89 100644
--- a/lib/libvarnishapi/vsl_arg.c
+++ b/lib/libvarnishapi/vsl_arg.c
@@ -343,7 +343,7 @@ VSL_Arg(struct VSL_data *vsl, int opt, const char *arg)
p++;
if (*p != '\0')
return (vsl_diag(vsl, "-L: Syntax error"));
- if (l < 0 || l > INT_MAX)
+ if (l <= 0 || l > INT_MAX)
return (vsl_diag(vsl, "-L: Range error"));
vsl->L_opt = (int)l;
return (1);
diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 1e4a617..f03f932 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -1344,7 +1344,8 @@ VSLQ_Dispatch(struct VSLQ *vslq, VSLQ_dispatch_f *func, void *priv)
}
/* Check store limit */
- while (vslq->n_outstanding > vslq->vsl->L_opt) {
+ while (vslq->n_outstanding > vslq->vsl->L_opt &&
+ !(VTAILQ_EMPTY(&vslq->incomplete))) {
vtx = VTAILQ_FIRST(&vslq->incomplete);
CHECK_OBJ_NOTNULL(vtx, VTX_MAGIC);
vtx_force(vslq, vtx, "store overflow");
More information about the varnish-commit
mailing list