- add rhbz to ChangeLog and move OPT functions declaration

- OPT functions declaration move to header files
- added rhbz to ChangeLog
This commit is contained in:
Luboš Uhliarik 2022-03-31 14:28:16 +02:00
parent af40323aac
commit 72f074878a
2 changed files with 55 additions and 34 deletions

View File

@ -10,6 +10,34 @@ index 05abe18..97484c9 100644
AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported]) AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported])
fi fi
fi fi
diff --git a/include/ap_listen.h b/include/ap_listen.h
index 58c2574..d5ed968 100644
--- a/include/ap_listen.h
+++ b/include/ap_listen.h
@@ -29,6 +29,7 @@
#include "apr_network_io.h"
#include "httpd.h"
#include "http_config.h"
+#include "apr_optional.h"
#ifdef __cplusplus
extern "C" {
@@ -143,6 +144,15 @@ AP_DECLARE_NONSTD(const char *) ap_set_receive_buffer_size(cmd_parms *cmd,
void *dummy,
const char *arg);
+#ifdef HAVE_SYSTEMD
+APR_DECLARE_OPTIONAL_FN(int,
+ ap_find_systemd_socket, (process_rec *, apr_port_t));
+
+APR_DECLARE_OPTIONAL_FN(int,
+ ap_systemd_listen_fds, (int));
+#endif
+
+
#define LISTEN_COMMANDS \
AP_INIT_TAKE1("ListenBacklog", ap_set_listenbacklog, NULL, RSRC_CONF, \
"Maximum length of the queue of pending connections, as used by listen(2)"), \
diff --git a/modules/arch/unix/mod_systemd.c b/modules/arch/unix/mod_systemd.c diff --git a/modules/arch/unix/mod_systemd.c b/modules/arch/unix/mod_systemd.c
index eda1272..fc059fc 100644 index eda1272..fc059fc 100644
--- a/modules/arch/unix/mod_systemd.c --- a/modules/arch/unix/mod_systemd.c
@ -91,10 +119,10 @@ index 0848d2e..8af2299 100644
APACHE_MODULE(log_debug, configurable debug logging, , , most) APACHE_MODULE(log_debug, configurable debug logging, , , most)
APACHE_MODULE(log_forensic, forensic logging) APACHE_MODULE(log_forensic, forensic logging)
diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c
index 0b11f60..04f08ca 100644 index 0b11f60..c3f0a51 100644
--- a/modules/loggers/mod_log_config.c --- a/modules/loggers/mod_log_config.c
+++ b/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c
@@ -172,14 +172,16 @@ @@ -172,10 +172,6 @@
#include <limits.h> #include <limits.h>
#endif #endif
@ -105,17 +133,7 @@ index 0b11f60..04f08ca 100644
#define DEFAULT_LOG_FORMAT "%h %l %u %t \"%r\" %>s %b" #define DEFAULT_LOG_FORMAT "%h %l %u %t \"%r\" %>s %b"
module AP_MODULE_DECLARE_DATA log_config_module; module AP_MODULE_DECLARE_DATA log_config_module;
@@ -1640,8 +1636,15 @@ static apr_status_t wrap_journal_stream(apr_pool_t *p, apr_file_t **outfd,
+#ifdef HAVE_SYSTEMD
+APR_DECLARE_OPTIONAL_FN(int,
+ ap_systemd_journal_stream_fd, (const char *, int, int));
+
+#endif
+
static int xfer_flags = (APR_WRITE | APR_APPEND | APR_CREATE | APR_LARGEFILE);
static apr_fileperms_t xfer_perms = APR_OS_DEFAULT;
@@ -1640,8 +1642,15 @@ static apr_status_t wrap_journal_stream(apr_pool_t *p, apr_file_t **outfd,
{ {
#ifdef HAVE_SYSTEMD #ifdef HAVE_SYSTEMD
int fd; int fd;
@ -132,8 +150,23 @@ index 0b11f60..04f08ca 100644
if (fd < 0) return fd; if (fd < 0) return fd;
/* This is an AF_UNIX socket fd so is more pipe-like than /* This is an AF_UNIX socket fd so is more pipe-like than
diff --git a/modules/loggers/mod_log_config.h b/modules/loggers/mod_log_config.h
index 877a593..bd52a98 100644
--- a/modules/loggers/mod_log_config.h
+++ b/modules/loggers/mod_log_config.h
@@ -69,6 +69,10 @@ APR_DECLARE_OPTIONAL_FN(ap_log_writer_init*, ap_log_set_writer_init,(ap_log_writ
*/
APR_DECLARE_OPTIONAL_FN(ap_log_writer*, ap_log_set_writer, (ap_log_writer* func));
+#ifdef HAVE_SYSTEMD
+APR_DECLARE_OPTIONAL_FN(int, ap_systemd_journal_stream_fd, (const char *, int, int));
+#endif
+
#endif /* MOD_LOG_CONFIG */
/** @} */
diff --git a/server/listen.c b/server/listen.c diff --git a/server/listen.c b/server/listen.c
index e2e028a..217caf2 100644 index e2e028a..aa6f91c 100644
--- a/server/listen.c --- a/server/listen.c
+++ b/server/listen.c +++ b/server/listen.c
@@ -34,10 +34,6 @@ @@ -34,10 +34,6 @@
@ -147,20 +180,7 @@ index e2e028a..217caf2 100644
/* we know core's module_index is 0 */ /* we know core's module_index is 0 */
#undef APLOG_MODULE_INDEX #undef APLOG_MODULE_INDEX
#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX #define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
@@ -65,6 +61,12 @@ static int send_buffer_size; @@ -325,34 +321,6 @@ static int find_listeners(ap_listen_rec **from, ap_listen_rec **to,
static int receive_buffer_size;
#ifdef HAVE_SYSTEMD
static int use_systemd = -1;
+
+APR_DECLARE_OPTIONAL_FN(int,
+ ap_find_systemd_socket, (process_rec *, apr_port_t));
+
+APR_DECLARE_OPTIONAL_FN(int,
+ ap_systemd_listen_fds, (int));
#endif
/* TODO: make_sock is just begging and screaming for APR abstraction */
@@ -325,34 +327,6 @@ static int find_listeners(ap_listen_rec **from, ap_listen_rec **to,
} }
#ifdef HAVE_SYSTEMD #ifdef HAVE_SYSTEMD
@ -195,7 +215,7 @@ index e2e028a..217caf2 100644
static apr_status_t alloc_systemd_listener(process_rec * process, static apr_status_t alloc_systemd_listener(process_rec * process,
int fd, const char *proto, int fd, const char *proto,
ap_listen_rec **out_rec) ap_listen_rec **out_rec)
@@ -412,6 +386,14 @@ static const char *set_systemd_listener(process_rec *process, apr_port_t port, @@ -412,6 +380,14 @@ static const char *set_systemd_listener(process_rec *process, apr_port_t port,
{ {
ap_listen_rec *last, *new; ap_listen_rec *last, *new;
apr_status_t rv; apr_status_t rv;
@ -210,7 +230,7 @@ index e2e028a..217caf2 100644
int fd = find_systemd_socket(process, port); int fd = find_systemd_socket(process, port);
if (fd < 0) { if (fd < 0) {
return "Systemd socket activation is used, but this port is not " return "Systemd socket activation is used, but this port is not "
@@ -438,7 +420,6 @@ static const char *set_systemd_listener(process_rec *process, apr_port_t port, @@ -438,7 +414,6 @@ static const char *set_systemd_listener(process_rec *process, apr_port_t port,
return NULL; return NULL;
} }
@ -218,7 +238,7 @@ index e2e028a..217caf2 100644
#endif /* HAVE_SYSTEMD */ #endif /* HAVE_SYSTEMD */
static const char *alloc_listener(process_rec *process, const char *addr, static const char *alloc_listener(process_rec *process, const char *addr,
@@ -707,6 +688,9 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s) @@ -707,6 +682,9 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s)
int num_listeners = 0; int num_listeners = 0;
const char* proto; const char* proto;
int found; int found;
@ -228,7 +248,7 @@ index e2e028a..217caf2 100644
for (ls = s; ls; ls = ls->next) { for (ls = s; ls; ls = ls->next) {
proto = ap_get_server_protocol(ls); proto = ap_get_server_protocol(ls);
@@ -746,7 +730,10 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s) @@ -746,7 +724,10 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s)
apr_pool_cleanup_null, s->process->pool); apr_pool_cleanup_null, s->process->pool);
} }
else { else {
@ -240,7 +260,7 @@ index e2e028a..217caf2 100644
} }
} }
else else
@@ -963,6 +950,9 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy, @@ -963,6 +944,9 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
apr_port_t port; apr_port_t port;
apr_status_t rv; apr_status_t rv;
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
@ -250,7 +270,7 @@ index e2e028a..217caf2 100644
if (err != NULL) { if (err != NULL) {
return err; return err;
@@ -973,7 +963,10 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy, @@ -973,7 +957,10 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
} }
#ifdef HAVE_SYSTEMD #ifdef HAVE_SYSTEMD
if (use_systemd == -1) { if (use_systemd == -1) {

View File

@ -815,6 +815,7 @@ exit $rv
%changelog %changelog
* Wed Mar 30 2022 Luboš Uhliarik <luhliari@redhat.com> - 2.4.53-2 * Wed Mar 30 2022 Luboš Uhliarik <luhliari@redhat.com> - 2.4.53-2
- Resolves: #2070517 - Allow install httpd with smaller footprint
- try to minimize httpd dependencies (new httpd-core package) - try to minimize httpd dependencies (new httpd-core package)
- mod_systemd and mod_brotli are now in the main httpd package - mod_systemd and mod_brotli are now in the main httpd package