Imporove debug messages

parent 3d9a2f4f
...@@ -479,8 +479,11 @@ fill_meta(VRT_CTX, struct zipflow_request *zfr) ...@@ -479,8 +479,11 @@ fill_meta(VRT_CTX, struct zipflow_request *zfr)
zfr->atime = ctx->now; zfr->atime = ctx->now;
if (zfr->mtime < 0) if (zfr->mtime < 0)
zfr->mtime = get_lm(ctx); zfr->mtime = get_lm(ctx);
VSLb(ctx->vsl, SLT_Debug, "%s %o %f %f", zfr->name, zfr->mode, if (DO_DEBUG(DBG_PROCESSORS)) {
VSLb(ctx->vsl, SLT_Debug, "zipflow meta "
"%s %o %f %f", zfr->name, zfr->mode,
zfr->atime, zfr->mtime); zfr->atime, zfr->mtime);
}
} }
int int
...@@ -566,9 +569,20 @@ zft_iter_req_body(struct zipflow_top *zft) ...@@ -566,9 +569,20 @@ zft_iter_req_body(struct zipflow_top *zft)
static int static int
vdp_zipflow_put(void *priv, void const *ptr, size_t len) vdp_zipflow_put(void *priv, void const *ptr, size_t len)
{ {
int r;
if (ptr != NULL && len == 0)
return (0);
return (VDP_bytes(priv, ptr == NULL ? VDP_END : VDP_FLUSH, r = VDP_bytes(priv, ptr == NULL ? VDP_END : VDP_FLUSH,
ptr, (ssize_t)len)); ptr, (ssize_t)len);
if (DO_DEBUG(DBG_PROCESSORS)) {
VSL(SLT_Debug, NO_VXID,
"zipflow put r=%d priv=%p ptr=%p len=%zu",
r, priv, ptr, len);
}
return (r);
} }
static void static void
...@@ -752,6 +766,11 @@ vdp_zipsub_bytes(struct vdp_ctx *vdc, enum vdp_action act, void **priv, ...@@ -752,6 +766,11 @@ vdp_zipsub_bytes(struct vdp_ctx *vdc, enum vdp_action act, void **priv,
assert(len >= 0); assert(len >= 0);
r = zip_data(zft->zip, ptr, (size_t)len, act == VDP_END ? 1 : 0); r = zip_data(zft->zip, ptr, (size_t)len, act == VDP_END ? 1 : 0);
if (DO_DEBUG(DBG_PROCESSORS)) {
VSL(SLT_Debug, NO_VXID,
"zipflow zip_data r=%d ptr=%p, len=%zd, end=%d",
r, ptr, len, act == VDP_END ? 1 : 0);
}
if (r) { if (r) {
VSLb(vdc->vsl, SLT_Error, "zip_data returned %d", r); VSLb(vdc->vsl, SLT_Error, "zip_data returned %d", r);
return (-1); return (-1);
...@@ -934,7 +953,7 @@ zfr_include(struct req *preq, struct zipflow_request *zfr) ...@@ -934,7 +953,7 @@ zfr_include(struct req *preq, struct zipflow_request *zfr)
if (s == REQ_FSM_DONE) if (s == REQ_FSM_DONE)
break; break;
DSL(DBG_WAITINGLIST, req->vsl->wid, DSL(DBG_WAITINGLIST, req->vsl->wid,
"waiting for zipflow (%d)", (int)s); "waiting for zipflow %p", zfr);
assert(s == REQ_FSM_DISEMBARK); assert(s == REQ_FSM_DISEMBARK);
AN(zfr->cond); AN(zfr->cond);
......
...@@ -12,7 +12,7 @@ server s1 { ...@@ -12,7 +12,7 @@ server s1 {
txresp -bodylen 20480 txresp -bodylen 20480
} -start } -start
varnish v1 -vcl+backend { varnish v1 -arg "-p debug=+waitinglist" -vcl+backend {
import zipflow; import zipflow;
sub vcl_recv { sub vcl_recv {
......
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