Commit 5a1b7707 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Adjust varnishncsa and varnishreplay for the new tag names

parent e37585df
...@@ -293,7 +293,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -293,7 +293,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_h = trimfield(ptr, end); lp->df_h = trimfield(ptr, end);
break; break;
case SLT_TxRequest: case SLT_BereqRequest:
if (!lp->active) if (!lp->active)
break; break;
if (lp->df_m != NULL) { if (lp->df_m != NULL) {
...@@ -303,7 +303,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -303,7 +303,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_m = trimline(ptr, end); lp->df_m = trimline(ptr, end);
break; break;
case SLT_TxURL: { case SLT_BereqURL: {
char *qs; char *qs;
if (!lp->active) if (!lp->active)
...@@ -322,7 +322,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -322,7 +322,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
break; break;
} }
case SLT_TxProtocol: case SLT_BereqProtocol:
if (!lp->active) if (!lp->active)
break; break;
if (lp->df_H != NULL) { if (lp->df_H != NULL) {
...@@ -332,7 +332,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -332,7 +332,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_H = trimline(ptr, end); lp->df_H = trimline(ptr, end);
break; break;
case SLT_RxStatus: case SLT_BerespStatus:
if (!lp->active) if (!lp->active)
break; break;
if (lp->df_s != NULL) { if (lp->df_s != NULL) {
...@@ -342,7 +342,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -342,7 +342,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_s = trimline(ptr, end); lp->df_s = trimline(ptr, end);
break; break;
case SLT_RxHeader: case SLT_BerespHeader:
if (!lp->active) if (!lp->active)
break; break;
if (isprefix(ptr, "content-length:", end, &next)) if (isprefix(ptr, "content-length:", end, &next))
...@@ -353,7 +353,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -353,7 +353,7 @@ collect_backend(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
} }
break; break;
case SLT_TxHeader: case SLT_BereqHeader:
if (!lp->active) if (!lp->active)
break; break;
split = strchr(ptr, ':'); split = strchr(ptr, ':');
...@@ -412,7 +412,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -412,7 +412,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_h = trimfield(ptr, end); lp->df_h = trimfield(ptr, end);
break; break;
case SLT_RxRequest: case SLT_ReqRequest:
if (!lp->active) if (!lp->active)
break; break;
if (lp->df_m != NULL) { if (lp->df_m != NULL) {
...@@ -422,7 +422,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -422,7 +422,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_m = trimline(ptr, end); lp->df_m = trimline(ptr, end);
break; break;
case SLT_RxURL: { case SLT_ReqURL: {
char *qs; char *qs;
if (!lp->active) if (!lp->active)
...@@ -441,7 +441,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -441,7 +441,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
break; break;
} }
case SLT_RxProtocol: case SLT_ReqProtocol:
if (!lp->active) if (!lp->active)
break; break;
if (lp->df_H != NULL) { if (lp->df_H != NULL) {
...@@ -451,7 +451,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -451,7 +451,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_H = trimline(ptr, end); lp->df_H = trimline(ptr, end);
break; break;
case SLT_TxStatus: case SLT_ObjStatus:
if (!lp->active) if (!lp->active)
break; break;
if (lp->df_s != NULL) if (lp->df_s != NULL)
...@@ -460,14 +460,14 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -460,14 +460,14 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
lp->df_s = trimline(ptr, end); lp->df_s = trimline(ptr, end);
break; break;
case SLT_TxHeader: case SLT_ObjHeader:
case SLT_RxHeader: case SLT_ReqHeader:
if (!lp->active) if (!lp->active)
break; break;
split = strchr(ptr, ':'); split = strchr(ptr, ':');
if (split == NULL) if (split == NULL)
break; break;
if (tag == SLT_RxHeader && if (tag == SLT_ReqHeader &&
isprefix(ptr, "authorization:", end, &next) && isprefix(ptr, "authorization:", end, &next) &&
isprefix(next, "basic", end, &next)) { isprefix(next, "basic", end, &next)) {
free(lp->df_u); free(lp->df_u);
...@@ -479,7 +479,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec, ...@@ -479,7 +479,7 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
AN(split); AN(split);
h->key = trimline(ptr, split); h->key = trimline(ptr, split);
h->value = trimline(split+1, end); h->value = trimline(split+1, end);
if (tag == SLT_RxHeader) if (tag == SLT_ReqHeader)
VTAILQ_INSERT_HEAD(&lp->req_headers, h, list); VTAILQ_INSERT_HEAD(&lp->req_headers, h, list);
else else
VTAILQ_INSERT_HEAD(&lp->resp_headers, h, list); VTAILQ_INSERT_HEAD(&lp->resp_headers, h, list);
......
...@@ -515,28 +515,28 @@ replay_thread(void *arg) ...@@ -515,28 +515,28 @@ replay_thread(void *arg)
thread_log(2, 0, "%s(%s)", VSL_tags[tag], msg->ptr); thread_log(2, 0, "%s(%s)", VSL_tags[tag], msg->ptr);
switch (tag) { switch (tag) {
case SLT_RxRequest: case SLT_ReqRequest:
if (thr->method != NULL) if (thr->method != NULL)
thr->bogus = 1; thr->bogus = 1;
else else
thr->method = trimline(thr, ptr); thr->method = trimline(thr, ptr);
break; break;
case SLT_RxURL: case SLT_ReqURL:
if (thr->url != NULL) if (thr->url != NULL)
thr->bogus = 1; thr->bogus = 1;
else else
thr->url = trimline(thr, ptr); thr->url = trimline(thr, ptr);
break; break;
case SLT_RxProtocol: case SLT_ReqProtocol:
if (thr->proto != NULL) if (thr->proto != NULL)
thr->bogus = 1; thr->bogus = 1;
else else
thr->proto = trimline(thr, ptr); thr->proto = trimline(thr, ptr);
break; break;
case SLT_RxHeader: case SLT_ReqHeader:
if (thr->nhdr >= sizeof thr->hdr / sizeof *thr->hdr) { if (thr->nhdr >= sizeof thr->hdr / sizeof *thr->hdr) {
thr->bogus = 1; thr->bogus = 1;
} else { } else {
......
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