diff --git a/httpd-2.4.62-freebind.patch b/httpd-2.4.62-freebind.patch new file mode 100644 index 0000000..93a0143 --- /dev/null +++ b/httpd-2.4.62-freebind.patch @@ -0,0 +1,124 @@ +diff --git a/docs/manual/mod/mpm_common.html.en b/docs/manual/mod/mpm_common.html.en +index d7a2fea..c911a4e 100644 +--- a/docs/manual/mod/mpm_common.html.en ++++ b/docs/manual/mod/mpm_common.html.en +@@ -42,6 +42,7 @@ more than one multi-processing module (MPM) +
Address already in use
error message,
+ including other causes.
+
+
++
++
++Description: | IP addresses and ports that the server ++listens to. Doesn't require IP address to be up |
---|---|
Syntax: | ListenFree [IP-address:]portnumber [protocol] |
Context: | server config |
Status: | MPM |
Module: | event , worker , prefork , mpm_winnt , mpm_netware , mpmt_os2 |
Compatibility: | This directive is currently available only in Red Hat Enterprise Linux |
The ListenFree
directive is
++ identical to the Listen
directive.
++ The only difference is in the usage of the IP_FREEBIND socket
++ option, which is enabled by default with ListenFree
.
++ If IP_FREEBIND is enabled, it allows httpd to bind to an IP
++ address that is nonlocal or does not (yet) exist. This allows httpd to
++ listen on a socket without requiring the underlying network interface
++ or the specified dynamic IP address to be up at the time when httpd
++ is trying to bind to it.
++
Description: | Sets the maximum amount of time to wait for data on the websockets tunnel |
---|---|
Syntax: | ProxyWebsocketIdleTimeout num[ms] |
Default: | ProxyWebsocketIdleTimeout 0 |
Context: | server config, virtual host |
Status: | Extension |
Module: | mod_proxy_wstunnel |
This directive imposes a maximum amount of time for the tunnel to be ++ left open while idle. The timeout is considered in seconds by default, but ++ it is possible to increase the time resolution to milliseconds ++ adding the ms suffix.
++ ++Available Languages: en |
+diff --git a/modules/proxy/mod_proxy_wstunnel.c b/modules/proxy/mod_proxy_wstunnel.c
+index 30ba1b4..e27e6f8 100644
+--- a/modules/proxy/mod_proxy_wstunnel.c
++++ b/modules/proxy/mod_proxy_wstunnel.c
+@@ -22,6 +22,7 @@ module AP_MODULE_DECLARE_DATA proxy_wstunnel_module;
+ typedef struct {
+ unsigned int fallback_to_proxy_http :1,
+ fallback_to_proxy_http_set :1;
++ apr_time_t idle_timeout;
+ } proxyws_dir_conf;
+
+ static int can_fallback_to_proxy_http;
+@@ -176,6 +177,8 @@ static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r,
+ conn_rec *c = r->connection;
+ apr_socket_t *sock = conn->sock;
+ conn_rec *backconn = conn->connection;
++ proxyws_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
++ &proxy_wstunnel_module);
+ char *buf;
+ apr_bucket_brigade *header_brigade;
+ apr_bucket *e;
+@@ -253,10 +256,13 @@ static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r,
+ c->keepalive = AP_CONN_CLOSE;
+
+ do { /* Loop until done (one side closes the connection, or an error) */
+- rv = apr_pollset_poll(pollset, -1, &pollcnt, &signalled);
++ rv = apr_pollset_poll(pollset, dconf->idle_timeout, &pollcnt, &signalled);
+ if (rv != APR_SUCCESS) {
+ if (APR_STATUS_IS_EINTR(rv)) {
+ continue;
++ } else if(APR_STATUS_IS_TIMEUP(rv)){
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "RH: the connection has timed out");
++ return HTTP_REQUEST_TIME_OUT;
+ }
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(02444) "error apr_poll()");
+ return HTTP_INTERNAL_SERVER_ERROR;
+@@ -442,11 +448,26 @@ cleanup:
+ return status;
+ }
+
++static const char * proxyws_set_idle(cmd_parms *cmd, void *conf, const char *val)
++{
++ proxyws_dir_conf *dconf = conf;
++ if (ap_timeout_parameter_parse(val, &(dconf->idle_timeout), "s") != APR_SUCCESS)
++ return "ProxyWebsocketIdleTimeout timeout has wrong format";
++
++ if (dconf->idle_timeout < 0)
++ return "ProxyWebsocketIdleTimeout timeout has to be a non-negative number";
++
++ if (!dconf->idle_timeout) dconf->idle_timeout = -1; /* loop indefinitely */
++
++ return NULL;
++}
++
+ static void *create_proxyws_dir_config(apr_pool_t *p, char *dummy)
+ {
+ proxyws_dir_conf *new =
+ (proxyws_dir_conf *) apr_pcalloc(p, sizeof(proxyws_dir_conf));
+
++ new->idle_timeout = -1; /* no timeout */
+ new->fallback_to_proxy_http = 1;
+
+ return (void *) new;
+@@ -489,7 +510,8 @@ static const command_rec ws_proxy_cmds[] =
+ proxyws_fallback_to_proxy_http, NULL, RSRC_CONF|ACCESS_CONF,
+ "whether to let mod_proxy_http handle the upgrade and tunneling, "
+ "On by default"),
+-
++ AP_INIT_TAKE1("ProxyWebsocketIdleTimeout", proxyws_set_idle, NULL, RSRC_CONF|ACCESS_CONF,
++ "timeout for activity in either direction, unlimited by default."),
+ {NULL}
+ };
+
diff --git a/httpd.spec b/httpd.spec
index ead081b..b8acc3b 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -25,7 +25,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.62
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc
@@ -96,6 +96,10 @@ Patch30: httpd-2.4.43-logjournal.patch
Patch31: httpd-2.4.53-separate-systemd-fns.patch
Patch32: httpd-2.4.58-r1912477+.patch
Patch33: httpd-2.4.54-selinux.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1949606
+Patch34: httpd-2.4.62-freebind.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1947496
+Patch35: httpd-2.4.62-proxy-ws-idle-timeout.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -827,6 +831,11 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Aug 08 2024 Luboš Uhliarik