File: 0009-From-upstream-module.patch

package info (click to toggle)
apache2 2.4.66-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 59,884 kB
  • sloc: ansic: 212,340; python: 13,830; perl: 11,307; sh: 7,266; php: 1,320; javascript: 1,314; awk: 749; makefile: 715; lex: 374; yacc: 161; xml: 2
file content (229 lines) | stat: -rw-r--r-- 9,479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <rouca@debian.org>
Date: Tue, 27 Jan 2026 23:54:33 +0100
Subject: From upstream module

http2 module was mismerged and some segfault still occurs. Fix mismerge by importing current
HEAD

origin: backport, https://github.com/icing/mod_h2/commit/b282ffb05cfdfb53c3fdcfb4a66cb79608a46c85
forwarded: not-needed
bug: https://github.com/icing/mod_h2/issues/313
debian-bug: http://bugs.debian.org/1126177
---
 modules/http2/h2_c1.c            | 5 ++++-
 modules/http2/h2_c2_filter.c     | 4 ++--
 modules/http2/h2_mplx.c          | 8 +++++---
 modules/http2/h2_proxy_session.c | 4 ++--
 modules/http2/h2_proxy_util.c    | 6 +++---
 modules/http2/h2_session.c       | 4 ++--
 modules/http2/h2_util.h          | 2 +-
 modules/http2/h2_version.h       | 2 +-
 modules/http2/h2_workers.c       | 5 +++++
 modules/http2/h2_ws.c            | 2 +-
 modules/http2/h2_ws.h            | 2 +-
 11 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/modules/http2/h2_c1.c b/modules/http2/h2_c1.c
index 626e665..f4604a4 100644
--- a/modules/http2/h2_c1.c
+++ b/modules/http2/h2_c1.c
@@ -47,7 +47,10 @@
 
 static struct h2_workers *workers;
 
-static int async_mpm, mpm_can_waitio;
+static int async_mpm;
+#ifdef AP_MPMQ_CAN_WAITIO
+static int mpm_can_waitio;
+#endif
 
 APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_in) *h2_c_logio_add_bytes_in;
 APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *h2_c_logio_add_bytes_out;
diff --git a/modules/http2/h2_c2_filter.c b/modules/http2/h2_c2_filter.c
index 554f88b..523a941 100644
--- a/modules/http2/h2_c2_filter.c
+++ b/modules/http2/h2_c2_filter.c
@@ -204,7 +204,7 @@ static int uniq_field_values(void *d, const char *key, const char *val)
          */
         for (i = 0, strpp = (char **) values->elts; i < values->nelts;
              ++i, ++strpp) {
-            if (*strpp && apr_strnatcasecmp(*strpp, start) == 0) {
+            if (*strpp && ap_cstr_casecmp(*strpp, start) == 0) {
                 break;
             }
         }
@@ -312,7 +312,7 @@ static h2_headers *create_response(request_rec *r)
 
         while (field && (token = ap_get_list_item(r->pool, &field)) != NULL) {
             for (i = 0; i < r->content_languages->nelts; ++i) {
-                if (!apr_strnatcasecmp(token, languages[i]))
+                if (!ap_cstr_casecmp(token, languages[i]))
                     break;
             }
             if (i == r->content_languages->nelts) {
diff --git a/modules/http2/h2_mplx.c b/modules/http2/h2_mplx.c
index 75518f4..8053f60 100644
--- a/modules/http2/h2_mplx.c
+++ b/modules/http2/h2_mplx.c
@@ -398,10 +398,11 @@ apr_status_t h2_mplx_c1_streams_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx)
 {
     stream_iter_ctx_t x;
     
-    H2_MPLX_ENTER(m);
-
     x.cb = cb;
     x.ctx = ctx;
+
+    H2_MPLX_ENTER(m);
+
     h2_ihash_iter(m->streams, m_stream_iter_wrap, &x);
         
     H2_MPLX_LEAVE(m);
@@ -1033,7 +1034,8 @@ static void s_c2_done(h2_mplx *m, conn_rec *c2, h2_conn_ctx_t *conn_ctx)
         int i;
 
         for (i = 0; i < m->spurge->nelts; ++i) {
-            if (stream == APR_ARRAY_IDX(m->spurge, i, h2_stream*)) {
+            stream = APR_ARRAY_IDX(m->spurge, i, h2_stream*);
+            if (stream && (stream->id == conn_ctx->stream_id)) {
                 ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, c2,
                               H2_STRM_LOG(APLOGNO(03517), stream, "already in spurge"));
                 ap_assert("stream should not be in spurge" == NULL);
diff --git a/modules/http2/h2_proxy_session.c b/modules/http2/h2_proxy_session.c
index acb17a5..3561c24 100644
--- a/modules/http2/h2_proxy_session.c
+++ b/modules/http2/h2_proxy_session.c
@@ -866,8 +866,8 @@ static apr_status_t open_stream(h2_proxy_session *session, const char *url,
              * Host: header */
             authority = r->server->server_hostname;
             ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(10511)
-                          "HTTP/0.9 request (with no host line) "
-                          "on incoming request and preserve host set "
+                          "incoming HTTP/0.9 request (with no Host header) "
+                          "and preserve host set, "
                           "forcing hostname to be %s for uri %s",
                           authority, r->uri);
             apr_table_setn(r->headers_in, "Host", authority);
diff --git a/modules/http2/h2_proxy_util.c b/modules/http2/h2_proxy_util.c
index bb384b9..c0b3948 100644
--- a/modules/http2/h2_proxy_util.c
+++ b/modules/http2/h2_proxy_util.c
@@ -381,7 +381,7 @@ static int iq_bubble_down(h2_proxy_iqueue *q, int i, int bottom,
  * h2_proxy_ngheader
  ******************************************************************************/
 #define H2_HD_MATCH_LIT_CS(l, name)  \
-    ((strlen(name) == sizeof(l) - 1) && !apr_strnatcasecmp(l, name))
+    ((strlen(name) == sizeof(l) - 1) && !ap_cstr_casecmp(l, name))
 
 static int h2_util_ignore_header(const char *name) 
 {
@@ -500,7 +500,7 @@ static int ignore_header(const literal *lits, size_t llen,
     
     for (i = 0; i < llen; ++i) {
         lit = &lits[i];
-        if (lit->len == nlen && !apr_strnatcasecmp(lit->name, name)) {
+        if (lit->len == nlen && !ap_cstr_casecmp(lit->name, name)) {
             return 1;
         }
     }
@@ -542,7 +542,7 @@ void h2_proxy_util_camel_case_header(char *s, size_t len)
 
 /** Match a header value against a string constance, case insensitive */
 #define H2_HD_MATCH_LIT(l, name, nlen)  \
-    ((nlen == sizeof(l) - 1) && !apr_strnatcasecmp(l, name))
+    ((nlen == sizeof(l) - 1) && !ap_cstr_casecmp(l, name))
 
 static apr_status_t h2_headers_add_h1(apr_table_t *headers, apr_pool_t *pool, 
                                       const char *name, size_t nlen,
diff --git a/modules/http2/h2_session.c b/modules/http2/h2_session.c
index 21ede5c..2f92150 100644
--- a/modules/http2/h2_session.c
+++ b/modules/http2/h2_session.c
@@ -125,7 +125,7 @@ static h2_stream *h2_session_open_stream(h2_session *session, int stream_id,
     apr_allocator_t *allocator;
     apr_pool_t *stream_pool;
     apr_status_t rv;
-    
+
     rv = apr_allocator_create(&allocator);
     if (rv != APR_SUCCESS)
       return NULL;
@@ -135,7 +135,7 @@ static h2_stream *h2_session_open_stream(h2_session *session, int stream_id,
     apr_allocator_owner_set(allocator, stream_pool);
     apr_pool_abort_set(abort_on_oom, stream_pool);
     apr_pool_tag(stream_pool, "h2_stream");
-    
+
     stream = h2_stream_create(stream_id, stream_pool, session, 
                               session->monitor, initiated_on);
     if (stream) {
diff --git a/modules/http2/h2_util.h b/modules/http2/h2_util.h
index 29d1799..e813bf5 100644
--- a/modules/http2/h2_util.h
+++ b/modules/http2/h2_util.h
@@ -337,7 +337,7 @@ apr_size_t h2_util_table_bytes(apr_table_t *t, apr_size_t pair_extra);
 
 /** Match a header value against a string constance, case insensitive */
 #define H2_HD_MATCH_LIT(l, name, nlen)  \
-    ((nlen == sizeof(l) - 1) && !apr_strnatcasecmp(l, name))
+    ((nlen == sizeof(l) - 1) && !ap_cstr_casecmp(l, name))
 
 /*******************************************************************************
  * HTTP/2 header helpers
diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h
index 8bcaf69..5c95a7d 100644
--- a/modules/http2/h2_version.h
+++ b/modules/http2/h2_version.h
@@ -27,7 +27,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "2.0.37"
+#define MOD_HTTP2_VERSION "2.0.37-git"
 
 /**
  * @macro
diff --git a/modules/http2/h2_workers.c b/modules/http2/h2_workers.c
index e7e2039..192dbc0 100644
--- a/modules/http2/h2_workers.c
+++ b/modules/http2/h2_workers.c
@@ -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) {
diff --git a/modules/http2/h2_ws.c b/modules/http2/h2_ws.c
index 3715225..4643660 100644
--- a/modules/http2/h2_ws.c
+++ b/modules/http2/h2_ws.c
@@ -239,7 +239,7 @@ static void ws_handle_resp(conn_rec *c2, h2_conn_ctx_t *conn_ctx,
                  * or in the request processings implementation of WebSockets */
                 ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c2, APLOGNO(10463)
                               "h2_c2(%s-%d): websocket CONNECT, 101 response "
-                              "with 'Sec-WebSocket-Accept: %s' but expected %s",
+                              "without 'Sec-WebSocket-Accept: %s' but expected %s",
                               conn_ctx->id, conn_ctx->stream_id, hd,
                               ws_ctx->ws_accept_base64);
             }
diff --git a/modules/http2/h2_ws.h b/modules/http2/h2_ws.h
index a94d300..4e8967c 100644
--- a/modules/http2/h2_ws.h
+++ b/modules/http2/h2_ws.h
@@ -23,7 +23,7 @@
  * Rewrite a websocket request.
  *
  * @param req the h2 request to rewrite
- * @param c2 the connection to process the request on
+ * @param conn the connection to process the request on
  * @param no_body != 0 iff the request is known to have no body
  * @return the websocket request for internal submit
  */