[master] e53d9e4 std.syslog() should ignore workspace overflows

Nils Goroll nils.goroll at uplex.de
Mon Nov 13 13:21:06 UTC 2017


commit e53d9e4ad3589d9c87aa8755b7b528fcdd416020
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Nov 13 14:13:57 2017 +0100

    std.syslog() should ignore workspace overflows
    
    As dicussed during bugwash.
    
    Ref #2489
    
    partially reverts 9701bc56d863c74f0181e090a7f045a13d13fb27

diff --git a/lib/libvmod_std/vmod.vcc b/lib/libvmod_std/vmod.vcc
index c98eb26..7c2ed1d 100644
--- a/lib/libvmod_std/vmod.vcc
+++ b/lib/libvmod_std/vmod.vcc
@@ -93,6 +93,11 @@ Description
 	Logs the string *s* to syslog tagged with *priority*. *priority*
 	is formed by ORing the facility and level values. See your
 	system's syslog.h file for possible values.
+
+	Notice: Unlike VCL and other functions in the std vmod, this
+	function will not fail VCL processing for workspace overflows:
+	For an out of workspace condition, the ``syslog()`` function
+	has no effect.
 Example
 	std.syslog(9, "Something is wrong");
 
diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index afc1f0a..7931dad 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -174,15 +174,8 @@ vmod_syslog(VRT_CTX, VCL_INT fac, const char *fmt, ...)
 	va_start(ap, fmt);
 	p = VRT_String(ctx->ws, NULL, fmt, ap);
 	va_end(ap);
-
-	if (p == NULL) {
-		WS_MarkOverflow(ctx->ws);
-		WS_Reset(ctx->ws, sn);
-		return;
-	}
-
-	AN(p);
-	syslog((int)fac, "%s", p);
+	if (p != NULL)
+		syslog((int)fac, "%s", p);
 	WS_Reset(ctx->ws, sn);
 }
 


More information about the varnish-commit mailing list