Skip to content

Commit

Permalink
Give VDP_push() a string ID argument for debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Mar 29, 2016
1 parent f6a7b61 commit 4c1625d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion bin/varnishd/cache/cache_deliver_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
}

void
VDP_push(struct req *req, vdp_bytes *func, void *priv, int bottom)
VDP_push(struct req *req, vdp_bytes *func, void *priv, int bottom,
const char *id)
{
struct vdp_entry *vdp;

Expand All @@ -79,6 +80,7 @@ VDP_push(struct req *req, vdp_bytes *func, void *priv, int bottom)
INIT_OBJ(vdp, VDP_ENTRY_MAGIC);
vdp->func = func;
vdp->priv = priv;
vdp->id = id;
if (bottom)
VTAILQ_INSERT_TAIL(&req->vdp, vdp, list);
else
Expand Down
4 changes: 2 additions & 2 deletions bin/varnishd/cache/cache_esi_deliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,9 @@ VED_Deliver(struct req *req, struct boc *boc, int wantbody)
ved_stripgzip(req, boc);
} else {
if (ecx->isgzip && !i)
VDP_push(req, ved_pretend_gzip, ecx, 1);
VDP_push(req, ved_pretend_gzip, ecx, 1, "PGZ");
else
VDP_push(req, ved_vdp_bytes, ecx->preq, 1);
VDP_push(req, ved_vdp_bytes, ecx->preq, 1, "VED");
(void)VDP_DeliverObj(req);
(void)VDP_bytes(req, VDP_FLUSH, NULL, 0);
}
Expand Down
4 changes: 3 additions & 1 deletion bin/varnishd/cache/cache_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ struct vdp_entry {
#define VDP_ENTRY_MAGIC 0x353eb781
vdp_bytes *func;
void *priv;
const char *id;
VTAILQ_ENTRY(vdp_entry) list;
};

int VDP_bytes(struct req *, enum vdp_action act, const void *ptr, ssize_t len);
void VDP_push(struct req *, vdp_bytes *func, void *priv, int bottom);
void VDP_push(struct req *, vdp_bytes *func, void *priv, int bottom,
const char *id);
void VDP_close(struct req *req);
int VDP_DeliverObj(struct req *req);

Expand Down
2 changes: 1 addition & 1 deletion bin/varnishd/cache/cache_range.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ vrg_dorange(struct req *req, const char *r)
vrg_priv->range_off = 0;
vrg_priv->range_low = low;
vrg_priv->range_high = high + 1;
VDP_push(req, vrg_range_bytes, vrg_priv, 1);
VDP_push(req, vrg_range_bytes, vrg_priv, 1, "RNG");
http_PutResponse(req->resp, "HTTP/1.1", 206, NULL);
return (NULL);
}
Expand Down
4 changes: 2 additions & 2 deletions bin/varnishd/cache/cache_req_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ cnt_transmit(struct worker *wrk, struct req *req)
if (sendbody >= 0) {
if (!req->disable_esi && req->resp_len != 0 &&
ObjHasAttr(wrk, req->objcore, OA_ESIDATA))
VDP_push(req, VDP_ESI, NULL, 0);
VDP_push(req, VDP_ESI, NULL, 0, "ESI");

if (cache_param->http_gzip_support &&
ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED) &&
!RFC2616_Req_Gzip(req->http))
VDP_push(req, VDP_gunzip, NULL, 1);
VDP_push(req, VDP_gunzip, NULL, 1, "GUZ");

if (cache_param->http_range_support &&
http_IsStatus(req->resp, 200)) {
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishd/http1/cache_http1_deliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
http_SetHeader(req->resp, "Connection: keep-alive");

if (sendbody && req->resp_len != 0)
VDP_push(req, v1d_bytes, NULL, 1);
VDP_push(req, v1d_bytes, NULL, 1, "V1B");

AZ(req->wrk->v1l);
V1L_Reserve(req->wrk, req->ws, &req->sp->fd, req->vsl, req->t_prev);
Expand Down

0 comments on commit 4c1625d

Please sign in to comment.