[master] 2e66e0b93 Make it the transports job to increment stats->client_req

Poul-Henning Kamp phk at FreeBSD.org
Tue Dec 11 11:51:12 UTC 2018


commit 2e66e0b93ba6e50fa5ef499cd6a4860d0fa56134
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Dec 11 11:49:30 2018 +0000

    Make it the transports job to increment stats->client_req

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 0a16ae808..5316c8a2e 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -78,8 +78,6 @@ cnt_transport(struct worker *wrk, struct req *req)
 		http_Unset(req->http, H_Expect);
 	}
 
-	wrk->stats->client_req++;
-
 	AZ(req->err_code);
 
 	req->doclose = http_DoConnection(req->http);
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 7210ab761..3ef60429d 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -441,6 +441,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
 		} else if (st == H1PROC) {
 			req->task.func = http1_req;
 			req->task.priv = req;
+			wrk->stats->client_req++;
 			if (CNT_Request(wrk, req) == REQ_FSM_DISEMBARK)
 				return;
 			req->task.func = NULL;
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 0ff9b03a6..76046d92f 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -536,6 +536,7 @@ h2_do_req(struct worker *wrk, void *priv)
 	THR_SetRequest(req);
 
 	req->http->conds = 1;
+	wrk->stats->client_req++;
 	if (CNT_Request(wrk, req) != REQ_FSM_DISEMBARK) {
 		AZ(req->ws->r);
 		h2 = r2->h2sess;


More information about the varnish-commit mailing list