[Varnish] #1599: std.syslog in V4 regression

Varnish varnish-bugs at varnish-cache.org
Mon Sep 22 22:34:44 CEST 2014


#1599: std.syslog in V4 regression
-----------------------+---------------------
 Reporter:  pstanhope  |       Type:  defect
   Status:  new        |   Priority:  highest
Milestone:  Later      |  Component:  vmod
  Version:  4.0.1      |   Severity:  blocker
 Keywords:             |
-----------------------+---------------------
 '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);
 ...

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1599>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list