Regression in std.syslog

Phil Stanhope stanhope at gmail.com
Mon Sep 22 21:15:39 CEST 2014


Hi all,

I've just found a regression in the syslog functionality in v4 std module.
Not sure when/where it emerged.

The log(...) method and the syslog(...) methods where updated to use
workspace. But the implementation is slightly different and the result is
that the syslog method writes an empty string to syslog.

...
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
u = WS_Reserve(ctx->ws, 0);
p = ctx->ws->f;
va_start(ap, fmt);
p = VRT_StringList(p, u, fmt, ap);
va_end(ap);
if (p != NULL)
  syslog((int)fac, "%s", p);
WS_Release(ctx->ws, 0);
...

I think it should be:

...
* txt t;*
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
u = WS_Reserve(ctx->ws, 0);
* t.b = ctx->ws->f;*
va_start(ap, fmt);
* t.e = VRT_StringList(t.b, u, fmt, ap);*
va_end(ap);
* if (t.e != NULL) {*
*  assert(t.e > t.b);*
*  t.e--;*
*  syslog((int)fac, "%s", t.b);*
* }*
WS_Release(ctx->ws, 0);
...

Thoughts?

-phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20140922/273e5531/attachment.html>


More information about the varnish-dev mailing list