[master] db326b8 Polish

Federico G. Schwindt fgsch at lodoss.net
Mon Sep 19 09:41:08 CEST 2016


commit db326b812a5c583808f58e4bb841cc06fe20df88
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Sep 19 08:29:08 2016 +0100

    Polish

diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index a76fa78..6354d69 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -140,15 +140,11 @@ vmod_log(VRT_CTX, const char *s, ...)
 	va_list ap;
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
-	WS_Assert(ctx->ws);
-
-
 	u = WS_Reserve(ctx->ws, 0);
 	t.b = ctx->ws->f;
 	va_start(ap, s);
 	t.e = VRT_StringList(ctx->ws->f, u, s, ap);
 	va_end(ap);
-
 	if (t.e != NULL) {
 		assert(t.e > t.b);
 		t.e--;
@@ -168,17 +164,14 @@ vmod_syslog(VRT_CTX, VCL_INT fac, const char *fmt, ...)
 	txt t;
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
+	u = WS_Reserve(ctx->ws, 0);
+	t.b = ctx->ws->f;
 	va_start(ap, fmt);
-	if (ctx->ws != NULL) {
-		u = WS_Reserve(ctx->ws, 0);
-		t.b = ctx->ws->f;
-		t.e = VRT_StringList(ctx->ws->f, u, fmt, ap);
-		if (t.e != NULL)
-			syslog((int)fac, "%s", t.b);
-		WS_Release(ctx->ws, 0);
-	} else
-		vsyslog((int)fac, fmt, ap);
+	t.e = VRT_StringList(ctx->ws->f, u, fmt, ap);
 	va_end(ap);
+	if (t.e != NULL)
+		syslog((int)fac, "%s", t.b);
+	WS_Release(ctx->ws, 0);
 }
 
 VCL_VOID __match_proto__(td_std_collect)



More information about the varnish-commit mailing list