Skip to content

Commit

Permalink
*) mod_http2: sync with github version
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911720 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
icing committed Aug 16, 2023
1 parent 9b7dbbe commit 29f9ed1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
6 changes: 3 additions & 3 deletions modules/http2/h2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion modules/http2/h2_c1_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions modules/http2/h2_c2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions modules/http2/h2_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
* @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
* Numerical representation of the version number of the http2 module
* 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 */
18 changes: 16 additions & 2 deletions modules/http2/mod_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion modules/http2/mod_proxy_http2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 29f9ed1

Please sign in to comment.