]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_htt2: recent small improvements from the github/icing/mod_h2
authorStefan Eissing <icing@apache.org>
Sun, 5 Mar 2023 09:42:53 +0000 (09:42 +0000)
committerStefan Eissing <icing@apache.org>
Sun, 5 Mar 2023 09:42:53 +0000 (09:42 +0000)
     - conditional use of ap_thread* to allow compilation on older versions
     - fixed checks on CONNECT requests

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908079 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_mplx.c
modules/http2/h2_request.c
modules/http2/h2_workers.c

index 99c47ea8ef9fdee77612f7bb7f38d2496146eda7..d23f0b5f336251b1f1984f5edc36463ef9134d23 100644 (file)
@@ -653,8 +653,10 @@ static apr_status_t c1_process_stream(h2_mplx *m,
     if (APLOGctrace1(m->c1)) {
         const h2_request *r = stream->request;
         ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c1,
-                      H2_STRM_MSG(stream, "process %s %s://%s%s"),
-                      r->method, r->scheme, r->authority, r->path);
+                      H2_STRM_MSG(stream, "process %s %s%s%s%s"),
+                      r->method, r->scheme? r->scheme : "",
+                      r->scheme? "://" : "",
+                      r->authority, r->path? r->path: "");
     }
 
     stream->scheduled = 1;
index bddbad5180d29baf5a4d45c253407ffd908f017a..4e60dbe0cb4485090021a319a3a53583f8f2fba7 100644 (file)
@@ -381,6 +381,11 @@ request_rec *h2_create_request_rec(const h2_request *req, conn_rec *c,
         r->the_request = apr_psprintf(r->pool, "%s %s HTTP/2.0",
                                       req->method, req->path);
     }
+    else if (!apr_strnatcasecmp("CONNECT", req->method)) {
+      /* CONNECT MUST NOT have scheme or path */
+      r->the_request = apr_psprintf(r->pool, "%s %s HTTP/2.0",
+                                    req->method, req->authority);
+    }
     else {
         /* We should only come here on a request that is errored already.
          * create a request line that passes parsing, we'll die anyway.
index e7e2039b90a04a971e94bfa6cb81e708c157a864..192dbc04f8a1f8f47ae2187de9ed402643c64c9e 100644 (file)
@@ -131,8 +131,13 @@ static apr_status_t activate_slot(h2_workers *workers)
     apr_pool_tag(pool, "h2_worker_slot");
     slot->pool = pool;
 
+#if defined(AP_HAS_THREAD_LOCAL)
     rv = ap_thread_create(&slot->thread, workers->thread_attr,
                           slot_run, slot, slot->pool);
+#else
+    rv = apr_thread_create(&slot->thread, workers->thread_attr,
+                           slot_run, slot, slot->pool);
+#endif
 
 cleanup:
     if (rv != APR_SUCCESS) {