[master] f8cf8c7 Rename sess_attr xport_priv to proto_priv because it is H1 & H2 which uses it.
Poul-Henning Kamp
phk at FreeBSD.org
Tue Feb 13 10:26:09 UTC 2018
commit f8cf8c77bd0202c54607e5cf1dad513d2cf1c8f2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Feb 13 10:23:00 2018 +0000
Rename sess_attr xport_priv to proto_priv because it is H1 & H2
which uses it.
Add a new sess_attr xport_priv which PROXY can use to keep state,
for instance for TLV attributes (see #2561)
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index c4cda48..9109f9b 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -58,7 +58,7 @@ http1_setstate(const struct sess *sp, const char *s)
uintptr_t p;
p = (uintptr_t)s;
- AZ(SES_Set_xport_priv(sp, &p));
+ AZ(SES_Set_proto_priv(sp, &p));
}
static const char *
@@ -66,7 +66,7 @@ http1_getstate(const struct sess *sp)
{
uintptr_t *p;
- AZ(SES_Get_xport_priv(sp, &p));
+ AZ(SES_Get_proto_priv(sp, &p));
return (const char *)*p;
}
@@ -114,7 +114,7 @@ http1_new_session(struct worker *wrk, void *arg)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
HTC_RxInit(req->htc, req->ws);
- SES_Reserve_xport_priv(sp, &u);
+ SES_Reserve_proto_priv(sp, &u);
http1_setstate(sp, H1NEWREQ);
wrk->task.func = http1_req;
wrk->task.priv = req;
diff --git a/bin/varnishd/http2/cache_http2_panic.c b/bin/varnishd/http2/cache_http2_panic.c
index da8c5eb..26bb42f 100644
--- a/bin/varnishd/http2/cache_http2_panic.c
+++ b/bin/varnishd/http2/cache_http2_panic.c
@@ -41,7 +41,7 @@ h2_sess_panic(struct vsb *vsb, const struct sess *sp)
struct h2_sess *h2;
struct h2_req *r2;
- AZ(SES_Get_xport_priv(sp, &up));
+ AZ(SES_Get_proto_priv(sp, &up));
h2 = (void*)*up;
CHECK_OBJ_NOTNULL(h2, H2_SESS_MAGIC);
diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index 599f908..6fe7bf4 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -102,9 +102,9 @@ h2_new_sess(const struct worker *wrk, struct sess *sp, struct req *srq)
uintptr_t *up;
struct h2_sess *h2;
- if (SES_Get_xport_priv(sp, &up)) {
+ if (SES_Get_proto_priv(sp, &up)) {
/* Already reserved if we came via H1 */
- SES_Reserve_xport_priv(sp, &up);
+ SES_Reserve_proto_priv(sp, &up);
*up = 0;
}
if (*up == 0) {
@@ -131,7 +131,7 @@ h2_new_sess(const struct worker *wrk, struct sess *sp, struct req *srq)
AZ(VHT_Init(h2->dectbl,
h2->local_settings.header_table_size));
- SES_Reserve_xport_priv(sp, &up);
+ SES_Reserve_proto_priv(sp, &up);
*up = (uintptr_t)h2;
}
AN(up);
diff --git a/include/tbl/sess_attr.h b/include/tbl/sess_attr.h
index 6b4494f..6b83fb3 100644
--- a/include/tbl/sess_attr.h
+++ b/include/tbl/sess_attr.h
@@ -40,6 +40,7 @@ SESS_ATTR(SERVER_ADDR, server_addr, struct suckaddr, vsa_suckaddr_len)
SESS_ATTR(CLIENT_IP, client_ip, char, -1)
SESS_ATTR(CLIENT_PORT, client_port, char, -1)
SESS_ATTR(XPORT_PRIV, xport_priv, uintptr_t, sizeof(uintptr_t))
+SESS_ATTR(PROTO_PRIV, proto_priv, uintptr_t, sizeof(uintptr_t))
#undef SESS_ATTR
/*lint -restore */
More information about the varnish-commit
mailing list