summaryrefslogtreecommitdiff
path: root/modules/http2
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2022-04-19 10:36:53 +0000
committerStefan Eissing <icing@apache.org>2022-04-19 10:36:53 +0000
commitb737bb84684852feb8e1e0c872a54198e91e93cd (patch)
treed1e83af1a3ba46497d53b3fb627facdaf1b669d3 /modules/http2
parent887ffec71205571029636c4b6e6df933625ee3c0 (diff)
downloadhttpd-b737bb84684852feb8e1e0c872a54198e91e93cd.tar.gz
*) mod_http2: using new session ids also in logging for connection
contexts and bucket beams. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900031 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http2')
-rw-r--r--modules/http2/h2_c1.c2
-rw-r--r--modules/http2/h2_conn_ctx.c6
-rw-r--r--modules/http2/h2_conn_ctx.h2
-rw-r--r--modules/http2/mod_http2.c2
4 files changed, 10 insertions, 2 deletions
diff --git a/modules/http2/h2_c1.c b/modules/http2/h2_c1.c
index 1f455c145c..1dc0de7c60 100644
--- a/modules/http2/h2_c1.c
+++ b/modules/http2/h2_c1.c
@@ -109,7 +109,7 @@ apr_status_t h2_c1_setup(conn_rec *c, request_rec *r, server_rec *s)
ctx = h2_conn_ctx_get(c);
ap_assert(ctx);
- ctx->session = session;
+ h2_conn_ctx_assign_session(ctx, session);
/* remove the input filter of mod_reqtimeout, now that the connection
* is established and we have switched to h2. reqtimeout has supervised
* possibly configured handshake timeouts and needs to get out of the way
diff --git a/modules/http2/h2_conn_ctx.c b/modules/http2/h2_conn_ctx.c
index 40a2701a50..b8a0fb3f17 100644
--- a/modules/http2/h2_conn_ctx.c
+++ b/modules/http2/h2_conn_ctx.c
@@ -68,6 +68,12 @@ h2_conn_ctx_t *h2_conn_ctx_create_for_c1(conn_rec *c1, server_rec *s, const char
return ctx;
}
+void h2_conn_ctx_assign_session(h2_conn_ctx_t *ctx, struct h2_session *session)
+{
+ ctx->session = session;
+ ctx->id = apr_psprintf(session->pool, "%d-%lu", session->child_num, (unsigned long)session->id);
+}
+
apr_status_t h2_conn_ctx_init_for_c2(h2_conn_ctx_t **pctx, conn_rec *c2,
struct h2_mplx *mplx, struct h2_stream *stream,
struct h2_c2_transit *transit)
diff --git a/modules/http2/h2_conn_ctx.h b/modules/http2/h2_conn_ctx.h
index b3c798c9be..02e4d1cb5a 100644
--- a/modules/http2/h2_conn_ctx.h
+++ b/modules/http2/h2_conn_ctx.h
@@ -79,6 +79,8 @@ typedef struct h2_conn_ctx_t h2_conn_ctx_t;
*/
h2_conn_ctx_t *h2_conn_ctx_create_for_c1(conn_rec *c, server_rec *s, const char *protocol);
+void h2_conn_ctx_assign_session(h2_conn_ctx_t *ctx, struct h2_session *session);
+
apr_status_t h2_conn_ctx_init_for_c2(h2_conn_ctx_t **pctx, conn_rec *c,
struct h2_mplx *mplx, struct h2_stream *stream,
struct h2_c2_transit *transit);
diff --git a/modules/http2/mod_http2.c b/modules/http2/mod_http2.c
index 4aa5155d77..36acc432f9 100644
--- a/modules/http2/mod_http2.c
+++ b/modules/http2/mod_http2.c
@@ -278,7 +278,7 @@ static const char *val_H2_STREAM_ID(apr_pool_t *p, server_rec *s,
conn_rec *c, request_rec *r, h2_conn_ctx_t *ctx)
{
const char *cp = val_H2_STREAM_TAG(p, s, c, r, ctx);
- if (cp && (cp = ap_strchr_c(cp, '-'))) {
+ if (cp && (cp = ap_strrchr_c(cp, '-'))) {
return ++cp;
}
return NULL;