1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

4254 Commits

Author SHA1 Message Date
Eric Covener
f63f26aff6 Merge r1935016 from trunk:
restrict per-dir file funcs centrally

Reviewed By: covener, jorton, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935017 13f79535-47bb-0310-9956-ffa450edef68
2026-06-05 10:28:53 +00:00
Eric Covener
7d9f3cfb10 Merge r1935014 from trunk:
ap_regname: restrict to reasonable captures

Reviewed By: covener, gbechis, jfclere



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935015 13f79535-47bb-0310-9956-ffa450edef68
2026-06-05 10:26:23 +00:00
Joe Orton
4b51444e86 Merge r1931452, r1931453 from trunk:
core: Add millisecond support to ErrorLogFormat time specifiers

%{m} prints the timestamp in millisecond-resolution.

* include/util_time.h:
  Define new AP_CTIME_OPTION_MSEC option for printing time in milliseconds
  format.

* server/util_time.c (ap_recent_ctime_ex):
  Handle AP_CTIME_OPTION_MSEC to print time in a millisecond format.

* server/log.c (log_ctime):
  Recognize the m time option in both fast-path and composite %{...}t formats.

Submitted by: Luboš Uhliarik <luhliari redhat.com>

* server/log.c (log_ctime): Fix syntax error in r1931452
  (added by me when tweaking whitespace, not from the PR author).

Reviewed by: jorton, covener, jim
Github: closes #599


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1934884 13f79535-47bb-0310-9956-ffa450edef68
2026-06-02 13:54:17 +00:00
Eric Covener
e66cbabeda Merge r1933389 from trunk:
Add ap_*_timingsafe() constant-time comparison functions:

* include/httpd.h: Declare ap_memeq_timingsafe(), ap_streq_timingsafe(), ap_strneq_timingsafe().

* server/util.c: Implement, wrapping apr_*_timingsafe() if APR >= 1.8, with a fallback to copied-in versions.

* modules/aaa/mod_auth_digest.c: Replace apr_crypto_equals() with ap_memeq_timingsafe(). Remove apr_crypto.h include.

* modules/session/mod_session_crypto.c: Replace local ap_crypto_equals() with ap_memeq_timingsafe(). Remove the local implementation and macro alias.

* include/ap_mmn.h: Bump MMN minor.

Submitted by:  jorton
Reviewed by: jorton, rpluem, covener

Github: closes #639


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1933444 13f79535-47bb-0310-9956-ffa450edef68
2026-04-28 18:10:32 +00:00
Eric Covener
383d5465ef Merge r1930163 from trunk:
envvars from HTTP headers low precedence



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1930167 13f79535-47bb-0310-9956-ffa450edef68
2025-12-01 12:06:00 +00:00
Eric Covener
b636047ed4 Merge r1930162 from trunk:
cover mixed slashes, simplify



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1930166 13f79535-47bb-0310-9956-ffa450edef68
2025-12-01 12:05:45 +00:00
Ruediger Pluem
a26b0095ca Merge r1927885, r1927916, r1928022 from trunk:
Make the value set for the socket option TCP_DEFER_ACCEPT configurable

* include/ap_listen.h:
  - Add prototype for ap_set_listentcpdeferaccept
  - Wire in new directive ListenTCPDeferAccept

* include/mpm_common.h:
  Define the previous static value as default value via DEFAULT_TCP_DEFER_ACCEPT

* server/listen.c:
  - Add static int ap_listentcpdeferaccept
  - ap_apply_accept_filter: Use value of ap_listenbacklog for setting TCP_DEFER_ACCEPT
  - ap_listen_pre_config: Set default value
  - Add ap_set_listentcpdeferaccept



* Follow up to r1927885: Use correct configuration variable. Thanks to @ylavic
  for finding this.


* Follow up to r1927885: Changelog entry and documentation

Reviewed by: rpluem, jorton, covener

Github: closes #555


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1929574 13f79535-47bb-0310-9956-ffa450edef68
2025-11-07 08:32:34 +00:00
Eric Covener
8efe8ea18c backport 1927033 from trunk
expand UNC checking

Reviewed By: covener, jfclere, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1927041 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 12:02:22 +00:00
Ruediger Pluem
22ce169f2c Merge r1511033, r1528032, r1608686, r1608694, r1608703, r1899784, r1916312, r1916344, r1838271, r1926091 from trunk:
Add support for systemd socket activation to listener sockets.


* configure.in: Simplify/fix systemd detection: move later to fix
  autoconf warnings; define HAVE_SYSTEMD rather than using CPPFLAGS.

* server/listen.c: Use HAVE_SYSTEMD for systemd #define.

* modules/arch/unix/config5.m4: Update systemd headers check.


* server/listen.c: duplicate sockets correctly when using systemd socket
activation, fix addrlen in getsockname() call.



Follow up r1608686, pass process to alloc_systemd_listener.


* server/listen.c: detect systemd socket activation using sd_listen_fds(),
drop the support for "Listen systemd" and use standard Listen syntax instead.

This allows using the same configuration file with or without socket activation
and allows setting protocol when using socket activation.



Remove libsystemd dependency from main httpd binary

Until this change httpd was linking libsystemd to the main httpd binary. If you want to run lightweight version of httpd in container, sometimes you just want to install
httpd binary with as little dependencies as possible to make container small in size and do not pull uncencessary dependencies and libraries.

This change will move all systemd library calls from listen.c to mod_systemd module and remove systemd linking from the main httpd bin.
Fixed mixed declaration and wrongly declared variable.

Submitted by: Luboš Uhliarik <luhliari redhat.com>



mod_systemd: Axe APR_OPTIONAL_FN redeclarations to avoid compiler warning.

ap_find_systemd_socket() and ap_systemd_listen_fds() are already declared in
"ap_listen.h", so just include them.



mod_systemd: if SELinux is available and enabled, log the SELinux
context at startup, since this may vary when httpd is started via
systemd vs being started directly.

* modules/arch/unix/mod_systemd.c (systemd_post_config):
  Do nothing for the pre-config iteration.
  Log the SELinux context if available.

* modules/arch/unix/config5.m4: Detect libselinux.

Have at least one CI job build mod_systemd.



Fix a cppcheck warning.

Remove some dead code. Updating 'last' is pointless here.

Ensure that ALL fields of the ap_listen_rec structure are initialized

alloc_listener initializes more fields in the created ap_listen_rec structure
than alloc_systemd_listener as it has more data to add to this structure.
Ensure that all fields of the ap_listen_rec structure are initialized at
least with 0 as later code using this structure depends on this.



Reviewed by: rpluem, jorton, ylavic

Github: closes #515


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926113 13f79535-47bb-0310-9956-ffa450edef68
2025-06-04 09:41:25 +00:00
Ruediger Pluem
b861e717cd Merge r1923806 from trunk:
Fix variable declaration warning in scoreboard.c

Submitted by: Vladimír Chlup <vchlup redhat.com>
Github: closes #516

Reviewed by: rpluem, jorton, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926108 13f79535-47bb-0310-9956-ffa450edef68
2025-06-04 07:37:32 +00:00
Stefan Eissing
1caed4ed9f Merge /httpd/httpd/trunk:r1923754
*) scoreboard/mod_http2: record durations of HTTP/2 requests.
     PR 69579 [Pierre Brochard <pierre.brochard.1982@m4x.org>]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926080 13f79535-47bb-0310-9956-ffa450edef68
2025-06-03 08:02:35 +00:00
Joe Orton
8486d22d82 Merge r1917017, r1923218 from trunk:
* server/core.c (set_override): Catch errors returned by
  set_allow_opts() for a parsing fail in an Options= argument.

Submitted by: Zhou Qingyang <zhou1615 umn.edu>
Github: closes #310

Add a Changes entry related to r1917017

While at it, fix a small style issue (tab vs spaces)

Submitted by: jorton, jailletc36
Reviewed by: rjung (reduce code drift), jorton, jailletc36


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1923804 13f79535-47bb-0310-9956-ffa450edef68
2025-02-14 09:16:23 +00:00
Jim Jagielski
83ab7e7e1c *) Easy patches: synch 2.4.x and trunk
- server: Use apr_size_t instead of int to harden against overflows
         - mod_http2: DOXYGEN has nothing to do here, just remove this
                      strange "#if defined(DOXYGEN)"
         - test: make the compiler happy when using --enable-maintainer-mode
         - mod_proxy: Fix format string type check
         - mod_http2: Fix comment, no functional change
         - <various>: Remove unnecessary APLOGNO() use in TRACE-level logging
         - mod_cache_socache: Update comment only, to remove reference to
                              session cache
         - mod_dav: Fix error message formatting if an unauthenticated user
                    tries to use an authenticated user's lock token
         - <none>: trigger ci
         - server: Fix typo in comment



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1922956 13f79535-47bb-0310-9956-ffa450edef68
2025-01-07 15:00:40 +00:00
Eric Covener
82736c811b *) Windows: Make UNCList EXEC_ON_READ to be early enough for
`Include //computername/include.conf`. PR69313
     Trunk version of patch:
       https://svn.apache.org/r1920564
     Backport version for 2.4.x of patch:
       svn merge -c r1920564 ^/httpd/httpd/trunk .
     +1 covener, rpluem, steffenal




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1920979 13f79535-47bb-0310-9956-ffa450edef68
2024-09-27 13:08:17 +00:00
Yann Ylavic
8ace8c7fc9 Merge r1918003, r1918022, r1918035, r1918078, r1918098, r1918099, r1918257, r1918482, r1918483, r1918491, r1919141, r1919148 from trunk
*) mod_http2: sync with module's github.
    - on newer HTTPD versions, return connection monitoring
      to the event MPM when block on client updates.
      2.4.x versions still treat connections in the event
      MPM as KeepAlive and purge them on load in the middle
      of response processing.
    - spelling fixes
    - support for yield calls in c2 "network" filter


 mpm_event,core: Handle async POLLIN/POLLOUT in CONN_STATE_PROCESS state.

* include/httpd.h:
  Rename CONN_STATE_CHECK_REQUEST_LINE_READABLE to CONN_STATE_KEEPALIVE
  and CONN_STATE_READ_REQUEST_LINE to CONN_STATE_PROCESS, keeping the
  old enums as aliases. Rework comments about each state.

* server/mpm/event/event.c:
  Use the new states names.
  Let the process_connection hooks return CONN_STATE_PROCESS for mpm_event
  to POLLIN or POLLOUT depending on c->cs->sense being CONN_SENSE_WANT_READ
  or CONN_SENSE_WANT_WRITE respectively.
  Remove (ab)use of CONN_STATE_WRITE_COMPLETION with CONN_SENSE_WANT_READ to
  mean poll() for read (and the need for the obscure c->clogging_input_filters
  to make it work as expected). This is what CONN_STATE_PROCESS is for now.
  Update the comment about the states that can be returned by process_connection
  hooks (and their usage).
  Use the same queue (process_q renamed from write_completion_q) for polling
  connections in both CONN_STATE_PROCESS and CONN_STATE_WRITE_COMPLETION
  states since they both use the same (server_rec's) Timeout. This implies
  that both states are accounted as "write-completion" in mod_status for now.

* server/mpm/motorz/motorz.c, server/mpm/simple/simple_io.c, modules/http/http_core.c:
  Use the new states names (only).

* include/scoreboard.h:
  Change comment about process_score->write_completion to note that the
  counter refers to CONN_STATE_PROCESS connections returned to the MPM
  too.

* modules/http2/h2_c1.c:
  Return the c1 connection with the CONN_STATE_PROCESS state rather than
  CONN_STATE_WRITE_COMPLETION when waiting for a window update (i.e. ask
  the MPM to poll for read directly). This avoids the transition to
  CONN_STATE_KEEPALIVE which could kill the connection under high load.


Github: closes #448


Follow up to r1918022: MMN minor bump and checks for the new conn_state_e aliases' usability.

mpm_event: Don't spam with "Stopping process due to MaxConnectionsPerChild"

When MaxConnectionsPerChild is reached there may be some connections to process
still and the listener should stop writing this at every loop. Logging once
is enough.

* server/mpm/event/event.c(check_infinite_requests): Raise conns_this_child
  unconditionally.
  

mpm_event, mod_status: Separate processing and write completion queues.

As a follow up to r1918022 which handled the new CONN_STATE_PROCESS(ing) and
existing CONN_STATE_WRITE_COMPLETION in the same async queue, let's now have
two separates ones which allows more relevant async accounting in mod_status.

Rename CONN_STATE_PROCESS to CONN_STATE_PROCESSING as it's how it will be
called in mod_status.

* include/ap_mmn.h:
  MMN minor bump for process_score->processing counter.

* include/httpd.h:
  Rename CONN_STATE_PROCESS to CONN_STATE_PROCESSING.

* include/scoreboard.h:
  Add process_score->processing field.

* include/httpd.h, modules/http/http_core.c, modules/http2/h2_c1.c,
    server/mpm/event/event.c, server/mpm/motorz/motorz.c,
    server/mpm/simple/simple_io.c:
  Rename CONN_STATE_PROCESS to CONN_STATE_PROCESSING.

* server/mpm/event/event.c:
  Restore write_completion_q to handle connections in CONN_STATE_WRITE_COMPLETION.
  Use processing_q (renamed from process_q) solely for CONN_STATE_PROCESSING.
  Update process_score->processing according to the length of processing_q.
  
* modules/generators/mod_status.c:
  Show the value of process_score->processing in the stats.


Follow up to r1918098 (and r1918022): Push missing changes.

mpm_event,mod_http2: Keep compatibility with CONN_STATE_PROCESSING + OK

Before r1918022, returning OK with CONN_STATE_PROCESSING to mpm_event was
handled like/by CONN_STATE_LINGER "to not break old or third-party modules
which might return OK w/o touching the state and expect lingering close,
like with worker or prefork MPMs".

So we need a new return code to be allowed to apply the new POLLIN/POLLOUT
behaviour for CONN_STATE_PROCESSING, thus revive AGAIN as introduced by
Graham some times ago for a nonblocking WIP (moved to a branch/PR since then).

MPM event will advertise its ability to handle CONN_STATE_PROCESSING + AGAIN
with AP_MPMQ_CAN_AGAIN, and mod_http2 can use that to know how to return to
the MPM as expected. When !AP_MPMQ_CAN_AGAIN modules/mod_http2 can still use
CONN_STATE_WRITE_COMPLETION + CONN_SENSE_WANT_READ + c->clogging_input_filters
which will work in mpm_even-2.4.x still.

* include/ap_mmn.h:
  Bump MMN minor for AP_MPMQ_CAN_AGAIN and AGAIN.

* include/ap_mpm.h:
  Define AP_MPMQ_CAN_AGAIN.

* include/httpd.h:
  Define AGAIN.

* modules/http2/h2.h:
  No need for H2_USE_STATE_PROCESSING anymore with AP_MPMQ_CAN_AGAIN.

* modules/http2/h2_c1.c:
  For !keepalive case return to the MPM using CONN_STATE_PROCESSING + AGAIN
  or CONN_STATE_WRITE_COMPLETION + c->clogging_input_filters depending on
  AP_MPMQ_CAN_AGAIN only.

* modules/http2/h2_session.c:
  Can return to the MPM for h2_send_flow_blocked() provided it's async only.

* server/mpm/event/event.c:
  Rework process_socket()'s CONN_STATE_PROCESSING to handle AGAIN and preserve
  compatibility. Have a lingering_close label to goto there faster when
  process_lingering_close() is to be called. Improve relevant comments.


mpm_event,mod_http2,mod_status: Follow up to r1918257: CONN_STATE_ASYNC_WAITIO.

Per discussion on PR #449, have a separate state for returning the connection
to the MPM to wait for an IO (namely CONN_STATE_ASYNC_WAITIO), rather than
(ab)using CONN_STATE_PROCESSING.

This removes the need for AGAIN added in r1918257 (for now), and AP_MPMQ_CAN_AGAIN
is renamed to AP_MPMQ_CAN_WAITIO.

This is also the state that mod_status accounts for, so rename ->processing
to ->wait_io in process_score (shows as "wait-io" in mod_status and mod_lua).


mpm_event: Follow up to r1918482: CONN_STATE_ASYNC_WAITIO > CONN_STATE_LINGER.


mpm_event: Follow up to r1918482: CONN_STATE_LINGER* are not the last anymore.

Since CONN_STATE_ASYNC_WAITIO, we cannot check for < or >= CONN_STATE_LINGER
anymore to determine if in an lingering close state, so let's add a new
CONN_STATE_IS_LINGERING_CLOSE() macro for this and use it in mpm_event.

The test for state == CONN_STATE_LINGER in process_lingering_close() is a
bit weak too in order to call ap_start_lingering_close() the first time only,
so have a conn_state->linger_started flag instead.


mod_status: Follow up to r1918482: Bump colspan for the new wait-io colomn


mod_status: "Threads" span three colomns (busy, graceful, idle), not two.


Submitted by: icing, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic
Reviewed by: ylavic, icing, gbechis
Github: closes #449


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1919548 13f79535-47bb-0310-9956-ffa450edef68
2024-07-27 14:18:49 +00:00
Yann Ylavic
90052684a9 mpm_event: Simplify pollset "good methods" vs APR_POLLSET_WAKEABLE.
* server/mpm/event/event.c(setup_threads_runtime):
  Simplify pollset creation code.

All pollset "good methods" implement APR_POLLSET_WAKEABLE and wake-ability
is quite important for MPM event's correctness anyway so simplify code around
pollset creation so as not to suggest that APR_POLLSET_NODEFAULT if favored
against APR_POLLSET_WAKEABLE.

While at it account for the wakeup pipe in the pollset_size since not all
pollset methods seem to do it internally in APR.


mpm_worker: Fix AH00045 about children processes not terminating timely.

* server/mpm/worker/worker.c(setup_threads_runtime):
  Create pollset with APR_POLLSET_WAKEABLE to be able to wake up the listener
  when stopping.

* server/mpm/worker/worker.c(wakeup_listener):
  Wake up the listener using the wakeup pipe (apr_pollset_wakeup).

* server/mpm/worker/worker.c(join_workers):
  Like mpm_event, don't depend on `pthread_kill(listener_thread, 0)` to check
  whether the listener has exited (this does not work on some systems), but use
  the "dying" global variable instead which is set by the listener just before
  exiting.


mpm_event,mpm_worker: Comment about pollset sizing when APR_POLLSET_WAKEABLE.

Follow up to r1916925 and r1916926.


Merges r1916925, r1916926, r1916929 from trunk
Reviewed by: rjung, ylavic, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1919134 13f79535-47bb-0310-9956-ffa450edef68
2024-07-11 13:48:18 +00:00
Yann Ylavic
4326d6b904 factor out IS_SLASH, perdir fix
in per-dir, the filename will be internally redirected, so / is OK too.


don't add / to / in the non-perdir


match AP_IS_SLASH macro

followup to 1918651


Merges r1918651, r1918652, r1918663 from trunk
Reviewed by: covener, ylavic, rpluem
GH: close #458


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918668 13f79535-47bb-0310-9956-ffa450edef68
2024-06-26 14:56:47 +00:00
Eric Covener
554554b0eb Merge r1918551 from trunk:
add ap_set_content_type_ex to differentiate

trusted sources



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918560 13f79535-47bb-0310-9956-ffa450edef68
2024-06-24 17:54:34 +00:00
Eric Covener
6376801292 Merge r1918549 from trunk:
add UNCList directive on Windows 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918558 13f79535-47bb-0310-9956-ffa450edef68
2024-06-24 17:52:15 +00:00
Stefan Eissing
34c1eaef0d Merge of GH PR #440
*) core: Support zone/scope in IPv6 link-local addresses in Listen and
     VirtualHost directives (requires APR 1.7.x or later).  PR 59396
     [Joe Orton]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918539 13f79535-47bb-0310-9956-ffa450edef68
2024-06-24 12:30:01 +00:00
Joe Orton
453dbd9ad3 Merge r1917578 from trunk:
On Linux use the real thread id via gettid() in error logging,
where available, rather than the (meaningless) default
pthread_self()-as-integer interpretation:

* configure.in: Define DEFAULT_LOG_TID on Linux if gettid() is available.

* server/log.c: Define DEFAULT_LOG_TID as NULL by default.
  (do_errorlog_default): Use DEFAULT_LOG_TID as the argument to log_tid().

Reviewed by: jorton, ylavic, icing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1918489 13f79535-47bb-0310-9956-ffa450edef68
2024-06-21 14:31:54 +00:00
Joe Orton
008e6afcfd Merge r1879591 from trunk:
Check for and use gettid() directly if available; glibc 2.30 and later
provides a wrapper for the system call:

* configure.in: Check for gettid() and define HAVE_SYS_GETTID if
  gettid() is only usable via syscall().

* server/log.c (log_tid): Use gettid() directly if available.

Submitted by: jorton
Reviewed by: jorton, jfclere, gbechis
Github: closes #404


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915544 13f79535-47bb-0310-9956-ffa450edef68
2024-02-02 14:53:34 +00:00
Joe Orton
45cfbb36ce Merge r1909450 from trunk:
Make sources build with latest clang version

Submitted by: icing
Reviewed by: minfrin, ylavic, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915534 13f79535-47bb-0310-9956-ffa450edef68
2024-02-02 11:50:07 +00:00
Joe Orton
b51a8364f2 Merge r1811831 from trunk:
* server/util_script.c (ap_add_common_vars): Allow mod_env to override
  all system path environment variables, not just PATH.  (The
  behaviour for PATH alone was changed in r965679 for PR 43906.)

Submitted by: jorton
Reviewed by: minfrin, ylavic, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915496 13f79535-47bb-0310-9956-ffa450edef68
2024-01-31 15:41:38 +00:00
Rich Bowen
58303ee3c1 Updated typo NWGNUmakefile
dependencies was spelled dependancies.

Submitted by: StevenSedwick <133059415+StevenSedwick@users.noreply.github.com>

(Also applied to trunk)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915381 13f79535-47bb-0310-9956-ffa450edef68
2024-01-24 14:46:36 +00:00
Graham Leggett
8fe3cc79d1 Backport to v2.4:
*) core: Fix use after free warning with gcc -fanalyzer.
      trunk patch: http://svn.apache.org/r1892413
      2.4.x patch: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/httpd-2.4-use-after-free.patch
      +1: minfrin, ylavic, jorton



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1913983 13f79535-47bb-0310-9956-ffa450edef68
2023-11-20 13:17:25 +00:00
Stefan Eissing
0d1d79b020 Merge from trunk:
*) mod_http2: added support for bootstrapping WebSockets via HTTP/2, as
     described in RFC 8441. A new directive 'H2WebSockets on|off' has been
     added. The feature is by default not enabled.
     As also discussed in the manual, this feature should work for setups
     using "ProxyPass backend-url upgrade=websocket" without further changes.
     Special server modules for WebSockets will have to be adapted,
     most likely, as the handling if IO events is different with HTTP/2.
     HTTP/2 WebSockets are supported on platforms with native pipes. This
     excludes Windows.
     New directive `H2ProxyRequests on|off` to enable handling
     of HTTP/2 requests in a forward proxy configuration.
     General forward proxying is enabled via `ProxyRequests`. If the
     HTTP/2 protocol is also enabled for such a server/host, this new
     directive is needed in addition.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1911979 13f79535-47bb-0310-9956-ffa450edef68
2023-08-29 07:23:10 +00:00
Graham Leggett
99ebeeab00 Backport to v2.4:
*) core: Add formats %{z} and %{strftime-format} to ErrorLogFormat, and make
     sure that if the format is configured early enough it applies to every log
     line.  PR 62161.
     trunk patch: https://svn.apache.org/r1908380
                  https://svn.apache.org/r1908383
                  https://svn.apache.org/r1908384
                  https://svn.apache.org/r1908388
                  https://svn.apache.org/r1908389
                  https://svn.apache.org/r1908390
                  https://svn.apache.org/r1908393
                  https://svn.apache.org/r1908394
                  https://svn.apache.org/r1908406
                  https://svn.apache.org/r1908407
                  https://svn.apache.org/r1908556
                  https://svn.apache.org/r1908557
     2.4.x patch: svn merge -c 1908380,1908383-1908384,1908388-1908390,1908393-1908394,1908406-1908407,1908556-1908557 ^/httpd/httpd/trunk .
                  (merge works modulo MMN, or patch/PR below)
                  https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/350.diff
                  https://github.com/apache/httpd/pull/350
     +1: ylavic, rpluem, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1911079 13f79535-47bb-0310-9956-ffa450edef68
2023-07-17 21:16:59 +00:00
Graham Leggett
4d8bf133d8 Backport to v2.4:
*) core: Optimize send_brigade_nonblocking()
     trunk patch:
        https://svn.apache.org/r1892450
        https://svn.apache.org/r1909966
     2.4.x patch: svn merge -c 1892450,1909966 ^/httpd/httpd/trunk .
     +1: jailletc36, rpluem, icing



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1911074 13f79535-47bb-0310-9956-ffa450edef68
2023-07-17 20:36:38 +00:00
Graham Leggett
ff2e5a1196 Backport to v2.4:
*) Easy patches: synch 2.4.x and trunk
         - core: constify pointers in ap_expr lookup tables.  ~1/2Kb moves to r/o text section
         - core: Optimize performance in ap_normalize_path()
         - core: Optimize code flow in log_backtrace()
         - Fix a typo in README.cmake
         - Add a missing 'be' in README.CHANGES
     trunk patch:
          https://svn.apache.org/r1877350
          https://svn.apache.org/r1894021
          https://svn.apache.org/r1906379
          https://svn.apache.org/r1908657
          https://svn.apache.org/r1908150
     2.4.x patch: svn merge -c 1877350,1894021,1906379,1908657,1908150 ^/httpd/httpd/trunk .
     +1: jailletc36, rpluem, gbechis



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1911073 13f79535-47bb-0310-9956-ffa450edef68
2023-07-17 20:33:05 +00:00
Eric Covener
8b6d55f6a0 Merge r1906539 from trunk:
fail on bad header

Submitted By: covener
Reviewed By: covener, rpluem, gbechis


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1906541 13f79535-47bb-0310-9956-ffa450edef68
2023-01-10 13:20:09 +00:00
Jim Jagielski
4d37880753 Merge r1822857, r1876815, r1893499, r1900024, r1900152, r1900306, r1900559, r1900564, r1900691, r1900694 from trunk:
* Makefile.in (build/config_vars.out): Rebuild if build/config_vars.sh
  has changed.


sort safe_env_lst 
bz 64371


mod_optional_hook_import: debug message at APLOG_DEBUG level.



  *) de-duplicate ALOGNO from code copy.



ab: apr_base64_encode already NUL-terminate the output.

And returns the length including the trailing \0, so setting it at that
length is off by +1.



* Avoid an overflow on large inputs

PR: 66033


dav_get_liveprop_info() returns a long not an int.

Update the type of global_ns accordingly and update the format specifier when this variable is used in printf like functions.

This also aligns code with dav_core_insert_prop() in modules/dav/main/std_liveprop.c

Length computed by count_string() are accumulated in an apr_size_t, so be more consistent and use this data type also in this function.

Fix some typo

[skip ci]

Fix some typos

[skip ci]
Submitted by: jorton, gbechis, ylavic, icing, ylavic, rpluem, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, rpluem, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1903618 13f79535-47bb-0310-9956-ffa450edef68
2022-08-21 20:26:51 +00:00
Eric Covener
adefe64c3e Merge r1901645 from trunk:
fixed in 1.7 SVN but not released

just in case we reroll.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901646 13f79535-47bb-0310-9956-ffa450edef68
2022-06-04 20:21:24 +00:00
Eric Covener
a46d582ea5 Merge r1901619 from trunk:
force to 0 on 1.6 on Windows



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901620 13f79535-47bb-0310-9956-ffa450edef68
2022-06-04 12:07:17 +00:00
Eric Covener
8c14927162 Merge r1901500 from trunk:
handle large writes in ap_rputs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901501 13f79535-47bb-0310-9956-ffa450edef68
2022-06-01 12:34:16 +00:00
Eric Covener
ce259c4061 Merge r1901497 from trunk:
use a liberal default limit for LimitRequestBody of 1GB


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901499 13f79535-47bb-0310-9956-ffa450edef68
2022-06-01 12:31:48 +00:00
Eric Covener
6503d09ab5 Merge r1901494 from trunk:
fix types



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901495 13f79535-47bb-0310-9956-ffa450edef68
2022-06-01 12:21:45 +00:00
Stefan Eissing
5f3010a643 Merge /httpd/httpd/trunk:r1899858,1899865,1899884,1900991
*) mpm_event, mpm_worker: Handle children killed pathologically.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901234 13f79535-47bb-0310-9956-ffa450edef68
2022-05-25 12:09:36 +00:00
Yann Ylavic
c2cbd5f50f core: Disable TCP_NOPUSH optimization on OSX. BZ 66019.
OSX supports TCP_NOPUSH but does not release the data retained (in TCP stack)
when the option is unset. It seems that unsetting it before the last write
does not help either so just disable the optimization for OSX in the core
output filter to avoid uncontrollable transmission delays.

* server/core_filters.c():
  Add the sock_nopush() helper that does nothing on OSX and platforms not
  supporting TCP_NOPUSH or TCP_CORK.

* server/core_filters.c(send_brigade_nonblocking):
  Use sock_nopush() instead of apr_socket_opt_set() for APR_TCP_NOPUSH option.


Merge r1900100 from trunk.

Submitted by: ylavic
Reviewed by: ylavic, rpluem, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901201 13f79535-47bb-0310-9956-ffa450edef68
2022-05-24 09:03:30 +00:00
Yann Ylavic
138691a51c mpm_event: Fix accounting of active/total processes on ungraceful restart.
Children processes terminated by ap_{reclaim,relieve}_child_processes() were
were not un-accounted for total_daemons and active_daemons, which was done in
server_main_loop() only. This led to perform_idle_server_maintenance() thinking
it was over the limit of children processes and never create new ones.

Have this accounting right in event_note_child_{started,stopped}() which is
called both at runtime and reload time.

* server/mpm/event/event.c(struct event_retained_data):
  Rename field max_daemons_limit to max_daemon_used to better describe what
  it's about and to align with AP_MPMQ_MAX_DAEMON_USED.

* server/mpm/event/event.c(event_note_child_stopped):
  Renamed from event_note_child_killed() to clarify that it's not only called
  when a child is killed (i.e. on restart) but whenever a child has stopped.

* server/mpm/event/event.c(event_note_child_stopped):
  Move decrementing {active,total}_daemons and marking child's threads as
  SERVER_DEAD from server_main_loop() so that it's done both at runtime and
  reload time. Log the current number/state of daemons at APLOG_DEBUG level
  for each child stopped.

* server/mpm/event/event.c(event_note_child_started):
  Move incrementing {active,total}_daemons from make_child() for symmetry,
  given that make_child() calls event_note_child_started(). Log the current
  number/state of daemons at APLOG_DEBUG level for each child started.

* server/mpm/event/event.c(perform_idle_server_maintenance):
  Fix possible miscounting of retained->max_daemon_used accross the multiple
  calls to perform_idle_server_maintenance() if ListenCoresBucketsRatio > 0.
  Pass an int *max_daemon_used which starts at zero and is bumped consistently
  for all the buckets, while retained->max_daemon_used is updated only after
  all the buckets have been maintained.

* server/mpm/event/event.c(perform_idle_server_maintenance):
  Use event_note_child_stopped() to handle exited children processes.


Follow up to r1899777: CHANGES entry.


mpm_event: Follow up to r1899777: Fix max_daemon_used.


Merge r1899777, r1899786, r1899812 from trunk.
Fixes: BZ 66004
Submitted by: ylavic
Reviewed by: ylavic, rpluem, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901199 13f79535-47bb-0310-9956-ffa450edef68
2022-05-24 09:00:19 +00:00
Yann Ylavic
229dc3ac47 *) core: make ap_escape_quotes() work correctly on strings
with more than MAX_INT/2 characters, counting quotes double.
   Credit to <generalbugs@zippenhop.com> for finding this.


*) core: improved checks in ap_escape_quotes() for
   extra long strings (or resulting strings) that
   exceed ptrdiff_t ranges.


Merge r1899609, r1899905 from trunk.
Reviewed by: icing, rpluem, ylavic
Submitted by: icing, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901196 13f79535-47bb-0310-9956-ffa450edef68
2022-05-24 08:55:16 +00:00
Yann Ylavic
5a72f0fe6f core: Make sure and check that LimitXMLRequestBody fits in system memory.
LimitXMLRequestBody can not exceed the size needed to ap_escape_html2() the
body without failing to allocate memory, so enforce this at load time based
on APR_SIZE_MAX, and make sure that ap_escape_html2() is within the bounds.

Document the limits for LimitXMLRequestBody in our docs.


Merge r1898686 from trunk.
Submitted by: ylavic, rpluem
Reviewed by: ylavic, covener, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898693 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 14:48:54 +00:00
Yann Ylavic
19aa2d83b3 core: Simpler connection close logic if discarding the request body fails.
If ap_discard_request_body() sets AP_CONN_CLOSE by itself it simplifies and
allows to consolidate end_output_stream() and error_output_stream().


Merge r1898683 from trunk.
Submitted by: ylavic, rpluem
Reviewed by: ylavic, rpluem, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898692 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 14:46:08 +00:00
Yann Ylavic
285b6285e7 ap_regex: Use Thread Local Storage (if efficient) to avoid allocations.
PCRE2 wants an opaque context by providing the API to allocate and free it, so
to minimize these calls we maintain one opaque context per thread (in Thread
Local Storage, TLS) grown as needed, and while at it we do the same for PCRE1
ints vectors. Note that this requires a fast TLS mechanism to be worth it,
which is the case of apr_thread_data_get/set() from/to apr_thread_current()
when APR_HAS_THREAD_LOCAL; otherwise we'll do the allocation and freeing for
each ap_regexec().

The small stack vector is used for PCRE1 && !APR_HAS_THREAD_LOCAL only now.


Follow up to r1897240: APR_HAS_THREAD_LOCAL wants #ifdef instead of #if.


Follow up to r1897240: CHANGES entry.


ap_regex: PCRE needs buffers sized against the number of captures only.

No more (useless), no less (or PCRE will allocate a new buffer by itself to
satisfy the needs), so we should base our buffer size solely on the number
of captures in the regex (determined at compile time from the pattern).

The nmatch provided by the user is used to fill in pmatch only (up to that),
but "our" buffers are sized exactly as needed to avoid oversized allocations
or PCRE allocating by itself.


ap_regex: Follow up to r1897244: Fix pmatch overflow and returned value at limits.

Don't write to pmatch[nlimit:] when ncaps > nmatch, rc should not exceed nmatch
either as before r1897244.


ap_regex: Follow up to r1897240: Fix issues spotted by Rüdiger (thanks!).

#include "apr_thread_proc.h" is enough/needed by util_pcre.c and main.c.
Fix compilation (vector => ovector) for !HAVE_PCRE2 && APR_HAS_THREAD_LOCAL.
Check pcre2_match_data_create() return value for HAVE_PCRE2 && !APR_HAS_THREAD_LOCAL.


ap_regex: Follow up to r1897240: runtime fallback to alloc/free.

Even though APR_HAS_THREAD_LOCAL is compiled in, ap_regexec() might still be
called by non a apr_thread_t thread, let's fall back to alloc/free in this
case too.


ap_regex: Follow up to r1897240: no ap_thread_current() yet.


ap_regex: Follow up to r1897240: cleanups.


ap_regex: Follow up to r1897240: cleanup PCRE2 match data on exit.


ap_regex: Follow up to r1897240: #if APR_HAS_THREAD_LOCAL, not #ifdef.


core: Efficient ap_thread_current() with APR < 1.8.

#define ap_thread_create, ap_thread_current_create and ap_thread_current to
their apr-1.8+ equivalent if available, or implement them using the compiler's
thread_local mechanism if available, or finally provide stubs otherwise.

#define AP_HAS_THREAD_LOCAL to 1 in the two former case or 0 otherwise, while
AP_THREAD_LOCAL is defined to the compiler's keyword iff AP_HAS_THREAD_LOCAL.

Replace all apr_thread_create() calls with ap_thread_create() so that httpd
threads can use ap_thread_current()'s pool data as Thread Local Storage.

Bump MMN minor.

* include/httpd.h():
  Define AP_HAS_THREAD_LOCAL, AP_THREAD_LOCAL (eventually), ap_thread_create(),
  ap_thread_current_create() and ap_thread_current().
  
* server/util.c:
  Implement ap_thread_create(), ap_thread_current_create() and
  ap_thread_current() when APR < 1.8.

* modules/core/mod_watchdog.c, modules/http2/h2_workers.c,
    modules/ssl/mod_ssl_ct.c:
  Use ap_thread_create() instead of apr_thread_create.

* server/main.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current_create instead of APR's.

* server/util_pcre.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current instead of APR's.

* server/mpm/event/event.c, server/mpm/worker/worker.c,
    server/mpm/prefork/prefork.c:
  Use ap_thread_create() instead of apr_thread_create.
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable
  at child_init().
  
* server/mpm/winnt/child.c:
  Use ap_thread_create() instead of CreateThread().
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable


Follow up to r1897460: APLOGNOs.


Follow up to r1897460: !APR_HAS_THREAD implies no ap_thread_* either.


core: Follow up to r1897460: Implement and use ap_thread_current_after_fork().

thread_local variables are not (always?) reset on fork(), so we need a way
to set the current_thread to NULL in the child process.

Implement and use ap_thread_current_after_fork() for that.

* include/httpd.h:
  Define ap_thread_current_after_fork().

* server/util.c:
  Implement ap_thread_current_after_fork().

* server/mpm/event/event.c, server/mpm/prefork/prefork.c,
    server/mpm/worker/worker.c:
  Use ap_thread_current_after_fork().

* server/mpm/winnt/child.c:
  Windows processes are not fork()ed and each child runs the main(), so
  ap_thread_current_create() was already called there.


core: Follow up to r1897460: Provide ap_thread_main_create().

Replace ap_thread_current_create() by ap_thread_main_create() which is how
it's used by httpd. The former is now a local helper only to implement the
latter.

This allows to consolidate/factorize common code in the main() of httpd and
the unix MPMs.


ap_regex: Follow up to r1897240: Fetch the ovector _after_ the match.

Possibly(?) pcre2_match() can modifiy the given pcre2_match_data and invalidate
the old ovector, be safe and fetch it after.


main: Follow up to r1897240: Fix bad log copypasta.

Don't stderr printf the "stat" and "failed" results from the previous
apr_app_initialize() call for an error in ap_thread_main_create().


core: Follow up to r1897240: Opt-out for AP_HAS_THREAD_LOCAL and/or pcre's usage.

If the compiler's thread_local is not efficient enough on some platforms, or
not desired, have a way to disable its usage in httpd (at compile time).

Handle -DAP_NO_THREAD_LOCAL and/or -DAPREG_NO_THREAD_LOCAL as build opt-out for
thread_local usage in httpd gobally and/or in ap_regex only (respectively).


core: Follow up to r1897240: Provide/export ap_thread_current_create()

For completness, and possibly to ease backport to 2.4.x for MPM winnt.


core: Follow up to r1897240 & r1897691: Syntax.


Add compiled and loaded PCRE version numbers
to "httpd -V" output and to mod_info page.


Forgotten file needed for r1612934.


Minor mmn bump due to r1612940.


Backports: r1897240, r1897241, r1897242, r1897244, r1897248, r1897250,
           r1897260, r1897261, r1897263, r1897386, r1897459, r1897460,
           r1897461, r1897462, r1897472, r1897543, r1897651, r1897680,
           r1897689, r1897691, r1897692, r1612934, r1612940, r1613189
Submitted by: ylavic, rjung, rjung, rjung
Reviewed by: ylavic, rpluem, covener, steffenal, wrowe
GH: closes #289 (https://github.com/apache/httpd/pull/289)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898467 13f79535-47bb-0310-9956-ffa450edef68
2022-02-28 11:56:43 +00:00
William A. Rowe Jr
c602ba1481 Replace PCRE with PCRE2 where it is available
PCRE 8.45 from May '21 is at end-of-life and will not receive security
vulnerability attention. pcre2-10.x replaces this and has been updated 
(as of this time) as recently as Oct '21.

This patch removes the needless assignment of re_erroffset in the conf pool
by the worker threads; such mistakes break the shared copy-on-write pages of
memory that should have remained common between all httpd worker processes.

Two de-optimizations are inherent in this patch, the former ovector-on-stack
opportunity is lost. This is by design of pcre2, more serious exploits were
available with stack array underrun/overrun manipulation. Heap for all pcre
array processing is the recommendation of the implementor, enforced by API.

Safer that we either create a new general context using pool allocation
in heap (requires thread-pool args we don't have in our api), or recycle
a per-req, per-pool, TLS match_data buffer on heap of some arbitrary 10 elts
or so, for these most common cases. Since this can't be done portably in C89
we may revisit this optimization in post-2.4 releases.

This logic refuses to consider --without-pcre, which is nonsequitor.

Submitted by: [wrowe, Petr Pisar <ppisar redhat.com>, rjung]
Backports: 1773454 1773741 1773742 1773839 1773870 1773882 1814662 1881478



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898399 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 22:18:42 +00:00
Christophe Jaillet
4a0e77df1e Merge r1881379, r1892422, r1893011, r1897270, r1897271 from trunk
Easy patches: synch 2.4.x and trunk
   - mod_ssl: Fix a few warnings on 64 bits windows compilation
   - ap_escape_quotes(): Remove unneeded checks to improve performance
   - test/time-sem.c: unlock the accept mutex before exiting (error conditions)
   - mod_ext_filter: Fix a spurious -1 used as a APR_SIZE_T_FMT in an error message
   - mod_sed: fix some format string (s/lld/APR_INT64_T_FMT/)

Submitted by: jailletc36, rpluem, ylavic, jailletc36, jailletc36
Reviewed by: jailletc36, icing, rpluem
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898391 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 20:37:08 +00:00
Christophe Jaillet
73ce13be5a Merge r1589986, r1589995, r1633528 from trunk
*) Add the ldap function to the expression API, allowing LDAP filters and
     distinguished names based on expressions to be escaped correctly to
     guard against LDAP injection.

Submitted by: minfrin, minfrin, jailletc36
Reviewed by: minfrin, icing, covener
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898217 13f79535-47bb-0310-9956-ffa450edef68
2022-02-19 13:47:02 +00:00
Ruediger Pluem
93291d20b0 Merge r1896505 from trunk:
mpm_event: Fix a possible listener deadlock.  PR 65769.

When the listener starts accepting more connections than the number of workers
already started (due to scheduling), the listening sockets gets disabled (per
AH03269) but nothing was re-enabling them before the end of the connections,
despite the creation of more idle/available workers in the meantime.
In the wost case there is no idle worker when the listener accepts the first
connection thus nothing to wake up the listener blocked in poll() with no
socket, hence a deadlock.

Fix this by waking up the listener when a worker becomes idle and this unblocks
connections_above_limit(). This is also worthwhile when all the workers are
started (fully initialized runtime) since the number of idle workers is a
condition for connections_above_limit() anyway so the sooner the listeners are
re-enabled the better (the other condition is the number of connections which
is unblocked appropriately by decrement_connection_count() already).

Also when a child exists with ps->quiescing == 1 and it's caught by
server_main_loop() before perform_idle_server_maintenance(), active_daemons was
not decrement as needed (including accross restarts), leading to an invalid
active_daemons accounting.

* server/mpm/event/event.c(should_enable_listensocks):
  New helper that returns whether listenning sockets can be poll()ed again.

* server/mpm/event/event.c(decrement_connection_count, listener_thread):
  Use should_enable_listensocks() where previously open-coded.

* server/mpm/event/event.c(worker_thread):
  Wake up the listener when is_idle => 1 and should_enable_listensocks().
  Have a single point of exit when workers_may_exit to make sure that the
  wake always occurs (even when exiting).

* server/mpm/event/event.c(server_main_loop):
  Decrement active_daemons not only when !ps->quiescing but also when
  ps->quiescing == 1, i.e. all the cases not handled by
  perform_idle_server_maintenance() already.


Submitted by: ylavic
Reviewed by: rpluem, ylavic, gbechis


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1897149 13f79535-47bb-0310-9956-ffa450edef68
2022-01-17 08:43:50 +00:00
Yann Ylavic
a962ba7304 Merge r1895914, r1895921 from trunk:
*) http: Enforce that fully qualified uri-paths not to be forward-proxied
     have an http(s) scheme, and that the ones to be forward proxied have a
     hostname, per HTTP specifications.
     trunk patch: http://svn.apache.org/r1895914
                  http://svn.apache.org/r1895921
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/286.patch
     backport PR: https://github.com/apache/httpd/pull/286
     +1: ylavic, minfrin, gbechis


mod_proxy: Detect unix: scheme syntax errors at load time.

* modules/proxy/mod_proxy.c(add_pass, add_member, set_proxy_param,
                            proxysection):
  Check return value of ap_proxy_de_socketfy().

* modules/proxy/proxy_util.c(ap_proxy_get_worker_ex):
  Check return value of ap_proxy_de_socketfy().



http: Enforce that fully qualified uri-paths not to be forward-proxied
      have an http(s) scheme, and that the ones to be forward proxied have a
      hostname, per HTTP specifications.

The early checks avoid failing the request later on and thus save cycles
for those invalid cases.


Submitted by: ylavic
Reviewed by: ylavic, minfrin, gbechis
Closes #286


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895955 13f79535-47bb-0310-9956-ffa450edef68
2021-12-14 15:35:56 +00:00
Graham Leggett
4819c58566 Backport:
*) mpm_event: Restart stopping of idle children after a load peak. PR 65626.
     trunk patch: http://svn.apache.org/r1894285
                  http://svn.apache.org/r1894286
                  http://svn.apache.org/r1894291
                  http://svn.apache.org/r1895550
                  http://svn.apache.org/r1895553
                  http://svn.apache.org/r1895630
     backport PR: https://github.com/apache/httpd/pull/276
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/276.patch
     +1: ylavic, rpluem, minfrin
     ylavic: updated with r1894291 for correctness of perform_idle_server_maintenance()
             w.r.t. num_buckets > 1 and ease merging of r1895553, with r1895550 for
             correctness of active_daemons used in r1895553 and r1895630.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895871 13f79535-47bb-0310-9956-ffa450edef68
2021-12-13 10:43:53 +00:00