Compatibility with Varnish-Cache post 7f28888779fd14f99eb34e50f6fb07ea6bbff999

parent 52f046c7
......@@ -49,6 +49,11 @@
#include "vcc_file_if.h"
// varnish-cache pre 7f28888779fd14f99eb34e50f6fb07ea6bbff999
#ifndef NO_VXID
#define NO_VXID (0U)
#endif
#define VFAIL(ctx, fmt, ...) \
VRT_fail((ctx), "vmod file failure: " fmt, __VA_ARGS__)
......@@ -136,7 +141,8 @@ check(union sigval val)
if (errbuf == NULL) {
snprintf(rdr->errbuf, rdr->errlen, "vmod file failure: "
"cannot allocate temp err buffer");
VSL(SLT_Error, 0, "vmod file: cannot allocate temp err buffer");
VSL(SLT_Error, NO_VXID,
"vmod file: cannot allocate temp err buffer");
rdr->flags |= RDR_ERROR;
return;
}
......@@ -146,7 +152,7 @@ check(union sigval val)
if (info->log_checks) {
VTIM_format(VTIM_real(), timbuf);
VSL(SLT_Debug, 0,
VSL(SLT_Debug, NO_VXID,
"vmod file: %s.%s: check for %s running at %s",
rdr->vcl_name, rdr->obj_name, info->path, timbuf);
}
......@@ -155,14 +161,14 @@ check(union sigval val)
if ((fd = open(info->path, O_RDONLY)) < 0) {
if (errno == ENOENT && (flags & RDR_MAPPED) != 0) {
flags |= RDR_DELETED;
VSL(SLT_Debug, 0, "vmod file: %s.%s: %s is deleted but "
"already mapped", rdr->vcl_name, rdr->obj_name,
info->path);
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: %s is "
"deleted but already mapped", rdr->vcl_name,
rdr->obj_name, info->path);
goto out;
}
VERRMSG(rdr, errbuf, "%s.%s: cannot open %s: %s", rdr->vcl_name,
rdr->obj_name, info->path, VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -173,7 +179,7 @@ check(union sigval val)
VERRMSG(rdr, errbuf, "%s.%s: cannot read info about %s: %s",
rdr->vcl_name, rdr->obj_name, info->path,
VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -181,7 +187,7 @@ check(union sigval val)
if (!S_ISREG(st.st_mode)) {
VERRMSG(rdr, errbuf, "%s.%s: %s is not a regular file",
rdr->vcl_name, rdr->obj_name, info->path);
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -196,7 +202,7 @@ check(union sigval val)
if (info->log_checks) {
VTIM_format(VTIM_real(), timbuf);
VSL(SLT_Debug, 0, "vmod file: %s.%s: updating %s at %s",
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: updating %s at %s",
rdr->vcl_name, rdr->obj_name, info->path, timbuf);
}
......@@ -214,7 +220,7 @@ check(union sigval val)
VERRMSG(rdr, errbuf, "%s.%s: could not map %s: %s",
rdr->vcl_name, rdr->obj_name, info->path,
VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -224,7 +230,7 @@ check(union sigval val)
!= 0) {
VERRMSG(rdr, errbuf, "%s.%s: madvise(SEQUENTIAL): %s",
rdr->vcl_name, rdr->obj_name, VAS_errtxt(err));
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -232,7 +238,7 @@ check(union sigval val)
!= 0) {
VERRMSG(rdr, errbuf, "%s.%s: madvise(WILLNEED): %s",
rdr->vcl_name, rdr->obj_name, VAS_errtxt(err));
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -266,7 +272,7 @@ check(union sigval val)
VERRMSG(rdr, errbuf, "%s.%s: unmap failed: %s",
rdr->vcl_name, rdr->obj_name,
VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf);
VSL(SLT_Error, NO_VXID, errbuf);
flags |= RDR_ERROR;
}
}
......@@ -290,7 +296,7 @@ check(union sigval val)
if ((rdr->flags & RDR_ERROR) == 0 && info->log_checks) {
VTIM_format(VTIM_real(), timbuf);
VSL(SLT_Debug, 0, "vmod file: %s.%s: check for %s "
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: check for %s "
"finished successfully at %s", rdr->vcl_name,
rdr->obj_name, info->path, timbuf);
}
......@@ -526,7 +532,7 @@ vmod_reader__fini(struct VPFX(file_reader) **rdrp)
errno = 0;
if (timer_delete(rdr->timerid) != 0)
VSL(SLT_Error, 0, "vmod file %s.%s finalization: "
VSL(SLT_Error, NO_VXID, "vmod file %s.%s finalization: "
"cannot delete timer: %s", rdr->vcl_name,
rdr->obj_name, VAS_errtxt(errno));
}
......@@ -539,7 +545,7 @@ vmod_reader__fini(struct VPFX(file_reader) **rdrp)
errno = 0;
if (munmap(rdr->addr, rdr->info->len) != 0)
VSL(SLT_Error, 0, "vmod file %s.%s finalization: "
VSL(SLT_Error, NO_VXID, "vmod file %s.%s finalization: "
"unmap failed: %s", rdr->vcl_name, rdr->obj_name,
VAS_errtxt(errno));
}
......@@ -863,7 +869,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
VAS_errtxt(errno));
return (-1);
}
VSL(SLT_Debug, 0, "vmod file: %s.%s: timer restarted",
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: timer restarted",
rdr->vcl_name, rdr->obj_name);
if (rdr->flags & RDR_MAPPED)
......@@ -888,7 +894,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
AN(rdr->flags & RDR_MAPPED);
AZ(rdr->flags & RDR_DELETED);
AN(rdr->addr);
VSL(SLT_Debug, 0, "vmod file: %s.%s: re-mapped",
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: re-mapped",
rdr->vcl_name, rdr->obj_name);
}
return (0);
......@@ -903,7 +909,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
errno = 0;
if (timer_gettime(rdr->timerid, &timer) != 0) {
VSL(SLT_Error, 0,
VSL(SLT_Error, NO_VXID,
"vmod file: %s.%s: reading timer: %s",
rdr->vcl_name, rdr->obj_name,
VAS_errtxt(errno));
......@@ -912,14 +918,14 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
timer.it_value.tv_sec = 0;
timer.it_value.tv_nsec = 0;
if (timer_settime(rdr->timerid, 0, &timer, NULL) != 0) {
VSL(SLT_Error, 0,
VSL(SLT_Error, NO_VXID,
"vmod file: %s.%s: suspending timer: %s",
rdr->vcl_name, rdr->obj_name,
VAS_errtxt(errno));
continue;
}
rdr->flags &= ~RDR_TIMER_INIT;
VSL(SLT_Debug, 0, "vmod file: %s.%s: timer suspended",
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: timer suspended",
rdr->vcl_name, rdr->obj_name);
if ((rdr->flags & RDR_MAPPED) == 0)
......@@ -929,7 +935,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
AN(rdr->addr);
errno = 0;
if (munmap(rdr->addr, rdr->info->len) != 0) {
VSL(SLT_Error, 0,
VSL(SLT_Error, NO_VXID,
"vmod file: %s.%s: unmap failed: %s",
rdr->vcl_name, rdr->obj_name,
VAS_errtxt(errno));
......@@ -937,7 +943,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
}
rdr->flags &= ~RDR_MAPPED;
rdr->addr = NULL;
VSL(SLT_Debug, 0, "vmod file: %s.%s: unmapped",
VSL(SLT_Debug, NO_VXID, "vmod file: %s.%s: unmapped",
rdr->vcl_name, rdr->obj_name);
}
return (0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment