[master] adb21d8 Don't return early from VSL_Dispatch when cursor reports more data available
Martin Blix Grydeland
martin at varnish-cache.org
Tue Oct 15 11:08:33 CEST 2013
commit adb21d8e5f0b10923fce47ab4f8875d0597a9456
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Mon Oct 14 12:54:06 2013 +0200
Don't return early from VSL_Dispatch when cursor reports more data available
VSL_Dispatch would return with (1) when the cursor reports more data
available, causing the processing of ready transaction not to be
run. Would cause 'varnishlog -d' not to report any data in some
situations.
Add some comments about the different return points in VSL_Dispatch.
diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 3a572d6..2351244 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -1255,11 +1255,13 @@ VSLQ_Dispatch(struct VSLQ *vslq, VSLQ_dispatch_f *func, void *priv)
/* Check shmref list and buffer if necessary */
r = vslq_shmref_check(vslq);
if (r)
+ /* Buffering of shm ref failed */
return (r);
/* Process next cursor input */
i = vslq_next(vslq);
- if (i)
+ if (i < 0)
+ /* Cursor reports error condition */
return (i);
/* Check vtx timeout */
@@ -1285,8 +1287,10 @@ VSLQ_Dispatch(struct VSLQ *vslq, VSLQ_dispatch_f *func, void *priv)
if (!VTAILQ_EMPTY(&vslq->ready))
r = vslq_process_ready(vslq, func, priv);
if (r)
+ /* User return code */
return (r);
+ /* Return cursor return value */
return (i);
}
More information about the varnish-commit
mailing list