]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_http2: sync with github version
authorStefan Eissing <icing@apache.org>
Wed, 16 Aug 2023 10:59:38 +0000 (10:59 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 16 Aug 2023 10:59:38 +0000 (10:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911720 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2.h
modules/http2/h2_c1_io.c
modules/http2/h2_c2.c
modules/http2/h2_version.h
modules/http2/mod_http2.h
modules/http2/mod_proxy_http2.c

index 2bb59ecb9c08e15e25e91cdae3a778508e8e48dc..cfecb3d9a39693937deeb49cd00bae6259dd4150 100644 (file)
@@ -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 {
index 1d5cf4f33d897ee181d0729531b9e65e9aadd268..5ed4ee818e75cbbd81b5a5b77976123644613992 100644 (file)
@@ -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);
index 316b0cc46370dde1494c4f931fdeabc3472e4fd0..3c3c0f5a9f02bf7180a557820ea493916ba58f41 100644 (file)
@@ -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;
 }
 
index 59dc06c8b6a94c4733e0b92a466c07cae4563c71..cf89154e90e10b5954a7805ed3f90e3568fde96c 100644 (file)
@@ -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 */
index 78cf94c8aa318848c40dbf42092c4910c6da4a86..9cb04a6468615b4cc41e1b17a333c4f2133ed61b 100644 (file)
@@ -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,
index 8c0905f917c472bdc6e9419572cc13b731cdbce6..6e24dde4d47f8a3548cfbb09529570ef7fd9312c 100644 (file)
@@ -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),