[5.1] 1389fc9 Move and rename CNT_AcctLogCharge() to Req_AcctLogCharge()
Poul-Henning Kamp
phk at FreeBSD.org
Mon Apr 10 13:59:08 CEST 2017
commit 1389fc9667ccd85018db2aeecaf431256f8d4d04
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Apr 3 20:05:57 2017 +0000
Move and rename CNT_AcctLogCharge() to Req_AcctLogCharge()
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index bc79aa3..ee33de0 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -933,6 +933,7 @@ struct req *Req_New(const struct worker *, struct sess *);
void Req_Release(struct req *);
void Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req);
void Req_Fail(struct req *req, enum sess_close reason);
+void Req_AcctLogCharge(struct dstat *, struct req *);
/* cache_req_body.c */
int VRB_Ignore(struct req *);
@@ -942,7 +943,6 @@ void VRB_Free(struct req *);
/* cache_req_fsm.c [CNT] */
enum req_fsm_nxt CNT_Request(struct worker *, struct req *);
-void CNT_AcctLogCharge(struct dstat *, struct req *);
/* cache_session.c [SES] */
void SES_Wait(struct sess *, const struct transport *);
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 17682da..6931e16 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -199,7 +199,7 @@ ved_include(struct req *preq, const char *src, const char *host,
}
VRTPRIV_dynamic_kill(req->sp->privs, (uintptr_t)req);
- CNT_AcctLogCharge(wrk->stats, req);
+ Req_AcctLogCharge(wrk->stats, req);
VSL_End(req->vsl);
preq->vcl = req->vcl;
diff --git a/bin/varnishd/cache/cache_req.c b/bin/varnishd/cache/cache_req.c
index b95fc9e..a3499ca 100644
--- a/bin/varnishd/cache/cache_req.c
+++ b/bin/varnishd/cache/cache_req.c
@@ -43,6 +43,32 @@
#include "vtim.h"
+void
+Req_AcctLogCharge(struct dstat *ds, struct req *req)
+{
+ struct acct_req *a;
+
+ AN(ds);
+ CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
+
+ a = &req->acct;
+
+ if (req->vsl->wid && !(req->res_mode & RES_PIPE)) {
+ VSLb(req->vsl, SLT_ReqAcct, "%ju %ju %ju %ju %ju %ju",
+ (uintmax_t)a->req_hdrbytes,
+ (uintmax_t)a->req_bodybytes,
+ (uintmax_t)(a->req_hdrbytes + a->req_bodybytes),
+ (uintmax_t)a->resp_hdrbytes,
+ (uintmax_t)a->resp_bodybytes,
+ (uintmax_t)(a->resp_hdrbytes + a->resp_bodybytes));
+ }
+
+#define ACCT(foo) \
+ ds->s_##foo += a->foo; \
+ a->foo = 0;
+#include "tbl/acct_fields_req.h"
+}
+
/*--------------------------------------------------------------------
* Alloc/Free a request
*/
@@ -170,7 +196,7 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
/* Charge and log byte counters */
if (req->vsl->wid) {
- CNT_AcctLogCharge(wrk->stats, req);
+ Req_AcctLogCharge(wrk->stats, req);
VSL_End(req->vsl);
}
req->req_bodybytes = 0;
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index aa8e1d7..1723bed 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -1016,29 +1016,3 @@ CNT_Request(struct worker *wrk, struct req *req)
assert(nxt == REQ_FSM_DISEMBARK || req->ws->r == NULL);
return (nxt);
}
-
-void
-CNT_AcctLogCharge(struct dstat *ds, struct req *req)
-{
- struct acct_req *a;
-
- AN(ds);
- CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
-
- a = &req->acct;
-
- if (req->vsl->wid && !(req->res_mode & RES_PIPE)) {
- VSLb(req->vsl, SLT_ReqAcct, "%ju %ju %ju %ju %ju %ju",
- (uintmax_t)a->req_hdrbytes,
- (uintmax_t)a->req_bodybytes,
- (uintmax_t)(a->req_hdrbytes + a->req_bodybytes),
- (uintmax_t)a->resp_hdrbytes,
- (uintmax_t)a->resp_bodybytes,
- (uintmax_t)(a->resp_hdrbytes + a->resp_bodybytes));
- }
-
-#define ACCT(foo) \
- ds->s_##foo += a->foo; \
- a->foo = 0;
-#include "tbl/acct_fields_req.h"
-}
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 5bd4429..bd68ae8 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -197,7 +197,7 @@ http1_reembark(struct worker *wrk, struct req *req)
wrk->stats->busy_killed++;
AN (req->vcl);
VCL_Rel(&req->vcl);
- CNT_AcctLogCharge(wrk->stats, req);
+ Req_AcctLogCharge(wrk->stats, req);
Req_Release(req);
SES_Delete(sp, SC_OVERLOAD, NAN);
DSL(DBG_WAITINGLIST, req->vsl->wid, "kill from waiting list");
@@ -402,7 +402,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
if (hs < HTC_S_EMPTY) {
req->acct.req_hdrbytes +=
req->htc->rxbuf_e - req->htc->rxbuf_b;
- CNT_AcctLogCharge(wrk->stats, req);
+ Req_AcctLogCharge(wrk->stats, req);
Req_Release(req);
switch (hs) {
case HTC_S_CLOSE:
diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index 0dbb541..c12e2f5 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -205,7 +205,7 @@ h2_ou_session(struct worker *wrk, struct h2_sess *h2,
VSLb(h2->vsl, SLT_Debug, "H2: Bad HTTP-Settings");
AN (req->vcl);
VCL_Rel(&req->vcl);
- CNT_AcctLogCharge(wrk->stats, req);
+ Req_AcctLogCharge(wrk->stats, req);
Req_Release(req);
return (0);
}
@@ -366,7 +366,7 @@ h2_reembark(struct worker *wrk, struct req *req)
wrk->stats->busy_killed++;
AN (req->vcl);
VCL_Rel(&req->vcl);
- CNT_AcctLogCharge(wrk->stats, req);
+ Req_AcctLogCharge(wrk->stats, req);
Req_Release(req);
DSL(DBG_WAITINGLIST, req->vsl->wid, "kill from waiting list");
usleep(10000);
More information about the varnish-commit
mailing list