[4.0] 0b1fa10 Add varnishncsa logging of pipe requests

Andreas Plesner apj at mutt.dk
Tue Jun 24 11:31:57 CEST 2014


commit 0b1fa10ab261b6c0301d5b20fd13193a739bd978
Author: Andreas Plesner <apj at mutt.dk>
Date:   Mon Jun 23 15:32:11 2014 +0200

    Add varnishncsa logging of pipe requests
    
    Fixes #1269

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index d26808e..97cc5ea 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -558,7 +558,7 @@ parse_format(const char *format)
 			addf_requestline();
 			break;
 		case 's':	/* Status code */
-			addf_fragment(&CTX.frag[F_s], "");
+			addf_fragment(&CTX.frag[F_s], "-");
 			break;
 		case 't':	/* strftime */
 			addf_time(*p, TIME_FMT, NULL);
@@ -791,11 +791,13 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 					frag_fields(p, e, 1,
 					    &CTX.frag[F_tstart], 0, NULL);
 
-				} else if (isprefix(b, "Resp:", e, &p)) {
+				} else if (isprefix(b, "Resp:", e, &p) ||
+					isprefix(b, "PipeSess:", e, &p)) {
 					frag_fields(p, e, 1,
 					    &CTX.frag[F_tend], 0, NULL);
 
-				} else if (isprefix(b, "Process:", e, &p)) {
+				} else if (isprefix(b, "Process:", e, &p) ||
+					isprefix(b, "Pipe:", e, &p)) {
 					frag_fields(p, e, 2,
 					    &CTX.frag[F_ttfb], 0, NULL);
 				}
@@ -826,14 +828,15 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 					   wrong */
 					CTX.hitmiss = "miss";
 					CTX.handling = "error";
-				} else if (!strcasecmp(b, "pipe")) {
-					CTX.hitmiss = "miss";
-					CTX.handling = "pipe";
 				}
 				break;
 			case SLT_VCL_return:
-				if (!strcasecmp(b, "restart"))
+				if (!strcasecmp(b, "restart")) {
 					skip = 1;
+				} else if (!strcasecmp(b, "pipe")) {
+					CTX.hitmiss = "miss";
+					CTX.handling = "pipe";
+				}
 				break;
 			default:
 				break;



More information about the varnish-commit mailing list