summaryrefslogtreecommitdiffstats
path: root/modules/http2
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2023-08-16 12:59:38 +0200
committerStefan Eissing <icing@apache.org>2023-08-16 12:59:38 +0200
commit29f9ed1436ab20262bb83a15f54274a386ca4efb (patch)
tree40c5d31ea27e3539a8fc9573b8ae0b76f8bc0609 /modules/http2
parentTests: update pytest for curl 8.1.x bugs (diff)
downloadapache2-29f9ed1436ab20262bb83a15f54274a386ca4efb.tar.xz
apache2-29f9ed1436ab20262bb83a15f54274a386ca4efb.zip
*) mod_http2: sync with github version
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911720 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http2')
-rw-r--r--modules/http2/h2.h6
-rw-r--r--modules/http2/h2_c1_io.c2
-rw-r--r--modules/http2/h2_c2.c6
-rw-r--r--modules/http2/h2_version.h4
-rw-r--r--modules/http2/mod_http2.h18
-rw-r--r--modules/http2/mod_proxy_http2.c2
6 files changed, 29 insertions, 9 deletions
diff --git a/modules/http2/h2.h b/modules/http2/h2.h
index 2bb59ecb9c..cfecb3d9a3 100644
--- a/modules/http2/h2.h
+++ b/modules/http2/h2.h
@@ -39,7 +39,7 @@ struct h2_stream;
#define H2_USE_POLLFD_FROM_CONN 0
#endif
-#if H2_USE_POLLFD_FROM_CONN && H2_USE_PIPES
+#if H2_USE_PIPES
#define H2_USE_WEBSOCKETS 1
#else
#define H2_USE_WEBSOCKETS 0
@@ -128,10 +128,10 @@ typedef struct h2_session_props {
int completed_max; /* the highest remote stream completed */
int emitted_count; /* the number of local streams sent */
int emitted_max; /* the highest local stream id sent */
- unsigned int accepting : 1; /* if the session is accepting new streams */
- unsigned int shutdown : 1; /* if the final GOAWAY has been sent */
int error; /* the last session error encountered */
const char *error_msg; /* the short message given on the error */
+ unsigned int accepting : 1; /* if the session is accepting new streams */
+ unsigned int shutdown : 1; /* if the final GOAWAY has been sent */
} h2_session_props;
typedef enum h2_stream_state_t {
diff --git a/modules/http2/h2_c1_io.c b/modules/http2/h2_c1_io.c
index 1d5cf4f33d..5ed4ee818e 100644
--- a/modules/http2/h2_c1_io.c
+++ b/modules/http2/h2_c1_io.c
@@ -287,7 +287,7 @@ static apr_status_t pass_output(h2_c1_io *io, int flush)
rv = APR_SUCCESS;
goto cleanup;
}
-
+
io->unflushed = !APR_BUCKET_IS_FLUSH(APR_BRIGADE_LAST(io->output));
apr_brigade_length(io->output, 0, &bblen);
C1_IO_BB_LOG(c, 0, APLOG_TRACE2, "out", io->output);
diff --git a/modules/http2/h2_c2.c b/modules/http2/h2_c2.c
index 316b0cc463..3c3c0f5a9f 100644
--- a/modules/http2/h2_c2.c
+++ b/modules/http2/h2_c2.c
@@ -474,6 +474,7 @@ static apr_status_t http2_get_pollfd_from_conn(conn_rec *c,
struct apr_pollfd_t *pfd,
apr_interval_time_t *ptimeout)
{
+#if H2_USE_PIPES
if (c->master) {
h2_conn_ctx_t *ctx = h2_conn_ctx_get(c);
if (ctx) {
@@ -492,6 +493,11 @@ static apr_status_t http2_get_pollfd_from_conn(conn_rec *c,
return APR_SUCCESS;
}
}
+#else
+ (void)c;
+ (void)pdf;
+ (void)ptimeout;
+#endif /* H2_USE_PIPES */
return APR_ENOTIMPL;
}
diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h
index 59dc06c8b6..cf89154e90 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.20-git"
+#define MOD_HTTP2_VERSION "2.0.21"
/**
* @macro
@@ -35,7 +35,7 @@
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
-#define MOD_HTTP2_VERSION_NUM 0x020014
+#define MOD_HTTP2_VERSION_NUM 0x020015
#endif /* mod_h2_h2_version_h */
diff --git a/modules/http2/mod_http2.h b/modules/http2/mod_http2.h
index 78cf94c8aa..9cb04a6468 100644
--- a/modules/http2/mod_http2.h
+++ b/modules/http2/mod_http2.h
@@ -34,8 +34,22 @@ APR_DECLARE_OPTIONAL_FN(void,
#define AP_HTTP2_HAS_GET_POLLFD
-/* Get a apr_pollfd_t propulated for a h2 connection where
- * (c->master != NULL) is true. */
+/**
+ * Get a apr_pollfd_t populated for a h2 connection where
+ * (c->master != NULL) is true and pipes are supported.
+ * To be used in Apache modules implementing WebSockets in Apache httpd
+ * versions that do not support the corresponding `ap_get_pollfd_from_conn()`
+ * function.
+ * When available, use `ap_get_pollfd_from_conn()` instead of this function.
+ *
+ * How it works: pass in a `apr_pollfd_t` which gets populated for
+ * monitoring the input of connection `c`. If `c` is not a HTTP/2
+ * stream connection, the function will return `APR_ENOTIMPL`.
+ * `ptimeout` is optional and, if passed, will get the timeout in effect
+ *
+ * On platforms without support for pipes (e.g. Windows), this function
+ * will return `APR_ENOTIMPL`.
+ */
APR_DECLARE_OPTIONAL_FN(apr_status_t,
http2_get_pollfd_from_conn,
(conn_rec *c, struct apr_pollfd_t *pfd,
diff --git a/modules/http2/mod_proxy_http2.c b/modules/http2/mod_proxy_http2.c
index 8c0905f917..6e24dde4d4 100644
--- a/modules/http2/mod_proxy_http2.c
+++ b/modules/http2/mod_proxy_http2.c
@@ -158,8 +158,8 @@ static int proxy_http2_canon(request_rec *r, char *url)
search = r->args;
}
else {
+#ifdef PROXY_CANONENC_NOENCODEDSLASHENCODING
core_dir_config *d = ap_get_core_module_config(r->per_dir_config);
- #ifdef PROXY_CANONENC_NOENCODEDSLASHENCODING
int flags = d->allow_encoded_slashes && !d->decode_encoded_slashes ? PROXY_CANONENC_NOENCODEDSLASHENCODING : 0;
path = ap_proxy_canonenc_ex(r->pool, url, (int)strlen(url),