Mailing List Archive

[master] d6f11a543 Req_New() needs no wrk argument.
commit d6f11a543df1ccd09cfb0b3e3ccfcf8ef75d73fd
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Tue Oct 5 08:04:38 2021 +0000

Req_New() needs no wrk argument.

diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 20cf8a248..e9c174c0a 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -399,7 +399,7 @@ vca_make_session(struct worker *wrk, void *arg)
}
vca_tcp_opt_set(sp->fd, wa->acceptlsock->uds, 0);

- req = Req_New(wrk, sp);
+ req = Req_New(sp);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
req->htc->rfd = &sp->fd;

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 7518b215b..483e3c0b6 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -129,7 +129,7 @@ ved_include(struct req *preq, const char *src, const char *host,
return;
}

- req = Req_New(wrk, sp);
+ req = Req_New(sp);
AN(req);
THR_SetRequest(req);
AZ(req->vsl->wid);
diff --git a/bin/varnishd/cache/cache_req.c b/bin/varnishd/cache/cache_req.c
index 5b3fe1964..a3e0b150a 100644
--- a/bin/varnishd/cache/cache_req.c
+++ b/bin/varnishd/cache/cache_req.c
@@ -104,7 +104,7 @@ Req_LogHit(struct worker *wrk, struct req *req, struct objcore *oc,
*/

struct req *
-Req_New(const struct worker *wrk, struct sess *sp)
+Req_New(struct sess *sp)
{
struct pool *pp;
struct req *req;
@@ -112,7 +112,6 @@ Req_New(const struct worker *wrk, struct sess *sp)
unsigned sz, hl;
char *p, *e;

- CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
pp = sp->pool;
CHECK_OBJ_NOTNULL(pp, POOL_MAGIC);
diff --git a/bin/varnishd/cache/cache_varnishd.h b/bin/varnishd/cache/cache_varnishd.h
index fda1e4dba..57294faa9 100644
--- a/bin/varnishd/cache/cache_varnishd.h
+++ b/bin/varnishd/cache/cache_varnishd.h
@@ -400,7 +400,7 @@ void pan_pool(struct vsb *);
int VRG_CheckBo(struct busyobj *);

/* cache_req.c */
-struct req *Req_New(const struct worker *, struct sess *);
+struct req *Req_New(struct sess *);
void Req_Release(struct req *);
void Req_Rollback(VRT_CTX);
void Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req);
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index da8c5fea6..ccd9ee340 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -141,7 +141,7 @@ http1_unwait(struct worker *wrk, void *arg)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CAST_OBJ_NOTNULL(sp, arg, SESS_MAGIC);
WS_Release(sp->ws, 0);
- req = Req_New(wrk, sp);
+ req = Req_New(sp);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
req->htc->rfd = &sp->fd;
HTC_RxInit(req->htc, req->ws);
diff --git a/bin/varnishd/http2/cache_http2.h b/bin/varnishd/http2/cache_http2.h
index a075f6305..09c88187a 100644
--- a/bin/varnishd/http2/cache_http2.h
+++ b/bin/varnishd/http2/cache_http2.h
@@ -243,8 +243,7 @@ void H2_Send(struct worker *, struct h2_req *, h2_frame type, uint8_t flags,
uint32_t len, const void *, uint64_t *acct);

/* cache_http2_proto.c */
-struct h2_req * h2_new_req(const struct worker *, struct h2_sess *,
- unsigned stream, struct req *);
+struct h2_req * h2_new_req(struct h2_sess *, unsigned stream, struct req *);
int h2_stream_tmo(struct h2_sess *, const struct h2_req *, vtim_real);
void h2_del_req(struct worker *, struct h2_req *);
void h2_kill_req(struct worker *, struct h2_sess *, struct h2_req *, h2_error);
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 41f18d828..a9ce140bc 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -138,14 +138,13 @@ h2_connectionerror(uint32_t u)
/**********************************************************************/

struct h2_req *
-h2_new_req(const struct worker *wrk, struct h2_sess *h2,
- unsigned stream, struct req *req)
+h2_new_req(struct h2_sess *h2, unsigned stream, struct req *req)
{
struct h2_req *r2;

ASSERT_RXTHR(h2);
if (req == NULL)
- req = Req_New(wrk, h2->sess);
+ req = Req_New(h2->sess);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);

r2 = WS_Alloc(req->ws, sizeof *r2);
@@ -661,7 +660,7 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
return (H2SE_REFUSED_STREAM); // rfc7540,l,1200,1205
}
h2->highest_stream = h2->rxf_stream;
- r2 = h2_new_req(wrk, h2, h2->rxf_stream, NULL);
+ r2 = h2_new_req(h2, h2->rxf_stream, NULL);
}
CHECK_OBJ_NOTNULL(r2, H2_REQ_MAGIC);

diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index f8f7ae755..5d4e3ecd6 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -96,7 +96,7 @@ h2_local_settings(struct h2_settings *h2s)
*/

static struct h2_sess *
-h2_init_sess(const struct worker *wrk, struct sess *sp,
+h2_init_sess(struct sess *sp,
struct h2_sess *h2s, struct req *srq, struct h2h_decode *decode)
{
uintptr_t *up;
@@ -108,7 +108,7 @@ h2_init_sess(const struct worker *wrk, struct sess *sp,
assert(*up == 0);

if (srq == NULL)
- srq = Req_New(wrk, sp);
+ srq = Req_New(sp);
AN(srq);
h2 = h2s;
AN(h2);
@@ -278,7 +278,7 @@ h2_ou_session(struct worker *wrk, struct h2_sess *h2,
HTC_RxInit(h2->htc, h2->ws);

/* Start req thread */
- r2 = h2_new_req(wrk, h2, 1, req);
+ r2 = h2_new_req(h2, 1, req);
req->transport = &H2_transport;
assert(req->req_step == R_STP_TRANSPORT);
req->task->func = h2_do_req;
@@ -354,9 +354,9 @@ h2_new_session(struct worker *wrk, void *arg)

assert (req->err_code == H2_PU_MARKER || req->err_code == H2_OU_MARKER);

- h2 = h2_init_sess(wrk, sp, &h2s,
+ h2 = h2_init_sess(sp, &h2s,
req->err_code == H2_PU_MARKER ? req : NULL, &decode);
- h2->req0 = h2_new_req(wrk, h2, 0, NULL);
+ h2->req0 = h2_new_req(h2, 0, NULL);
AZ(h2->htc->priv);
h2->htc->priv = h2;

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit