You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2022/04/19 10:36:53 UTC

svn commit: r1900031 - in /httpd/httpd/trunk: modules/http2/h2_c1.c modules/http2/h2_conn_ctx.c modules/http2/h2_conn_ctx.h modules/http2/mod_http2.c test/modules/http2/test_004_post.py

Author: icing
Date: Tue Apr 19 10:36:53 2022
New Revision: 1900031

URL: http://svn.apache.org/viewvc?rev=1900031&view=rev
Log:
  *) mod_http2: using new session ids also in logging for connection
     contexts and bucket beams.


Modified:
    httpd/httpd/trunk/modules/http2/h2_c1.c
    httpd/httpd/trunk/modules/http2/h2_conn_ctx.c
    httpd/httpd/trunk/modules/http2/h2_conn_ctx.h
    httpd/httpd/trunk/modules/http2/mod_http2.c
    httpd/httpd/trunk/test/modules/http2/test_004_post.py

Modified: httpd/httpd/trunk/modules/http2/h2_c1.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_c1.c?rev=1900031&r1=1900030&r2=1900031&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_c1.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_c1.c Tue Apr 19 10:36:53 2022
@@ -109,7 +109,7 @@ apr_status_t h2_c1_setup(conn_rec *c, re
 
     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

Modified: httpd/httpd/trunk/modules/http2/h2_conn_ctx.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_conn_ctx.c?rev=1900031&r1=1900030&r2=1900031&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_conn_ctx.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_conn_ctx.c Tue Apr 19 10:36:53 2022
@@ -68,6 +68,12 @@ h2_conn_ctx_t *h2_conn_ctx_create_for_c1
     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)

Modified: httpd/httpd/trunk/modules/http2/h2_conn_ctx.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_conn_ctx.h?rev=1900031&r1=1900030&r2=1900031&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_conn_ctx.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_conn_ctx.h Tue Apr 19 10:36:53 2022
@@ -79,6 +79,8 @@ typedef struct h2_conn_ctx_t h2_conn_ctx
  */
 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);

Modified: httpd/httpd/trunk/modules/http2/mod_http2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/mod_http2.c?rev=1900031&r1=1900030&r2=1900031&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/mod_http2.c (original)
+++ httpd/httpd/trunk/modules/http2/mod_http2.c Tue Apr 19 10:36:53 2022
@@ -278,7 +278,7 @@ static const char *val_H2_STREAM_ID(apr_
                                     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;

Modified: httpd/httpd/trunk/test/modules/http2/test_004_post.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/http2/test_004_post.py?rev=1900031&r1=1900030&r2=1900031&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/test_004_post.py (original)
+++ httpd/httpd/trunk/test/modules/http2/test_004_post.py Tue Apr 19 10:36:53 2022
@@ -69,7 +69,7 @@ class TestPost:
         ("H2_PUSHED", ""),
         ("H2_PUSHED_ON", ""),
         ("H2_STREAM_ID", "1"),
-        ("H2_STREAM_TAG", r'\d+-1'),
+        ("H2_STREAM_TAG", r'\d+-\d+-1'),
     ])
     def test_h2_004_07(self, env, name, value):
         url = env.mkurl("https", "cgi", "/env.py")