| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Instead, we can simply go to ap_wait_or_timeout() again.
While at it, improve the comment about killed processes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899865 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If children processes get killed (SIGSEGV/SIGABRT/..) early after starting or
frequently enough then we never enter perform_idle_server_maintenance() to
try something.
Below three successive children killed restart them immediately, above three
let's sleep the usual 1s (to avoid fork()s flood) and do the idle maintenance.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899858 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899812 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*) core/mod_http: use REQUEST meta buckets and a new HTTP/1.x specific
input filter to separate the handling for HTTP requests from the
handling of HTTP/1.x request parsing and checks.
A new HTTP1_REQUEST_IN filter installs itself on http/1.1 connections
before a request is being read. It generates either a REQUEST meta
bucket on success or an ERROR bucket with the proposed response status.
The core connection processing, relying on ap_read_request(), now expects
a REQUEST or ERROR bucket from the input filters and is agnostic to
specific HTTP versions and how they bring requests into the server.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899799 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
Github: closes #312
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899784 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Fixes: BZ 66004
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899777 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
filter to send responses through the output filter chain.
Specifically: the HTTP_HEADER output filter and ap_send_interim_response()
create a RESPONSE bucket and no longer are concerned with HTTP/1.x
serialization.
A new HTTP1_RESPONSE_OUT transcode filter writes the proper HTTP/1.x
bytes when dealing with a RESPONSE bucket. That filter installs itself
on the pre_read_request hook when the connection has protocol 'http/1.1'.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899648 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
with more than MAX_INT/2 characters, counting quotes double.
Credit to <generalbugs@zippenhop.com> for finding this.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899609 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- adds new meta bucket types REQUEST, RESPONSE and HEADERS to the API.
- adds a new method for setting standard response headers Date and Server
- adds helper methods for formatting parts of HTTP/1.x, like headers and
end chunks for use in non-core parts of the server, e.g. mod_proxy
- splits the HTTP_IN filter into a "generic HTTP" and "specific HTTP/1.x"
filter. The latter one named HTTP1_BODY_IN.
- Uses HTTP1_BODY_IN only for requests with HTTP version <= 1.1
- Removes the chunked input simulation from mod_http2
- adds body_indeterminate flag to request_rec that indicates that a request
body may be present and needs to be read/discarded. This replaces logic
that thinks without Content-Length and Transfer-Encoding, no request
body can exist.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899547 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
create_secondary_connection and ap_create_secondary_connection()
to setup connections related to a "master" one, as used in
the HTTP/2 protocol implementation.
*) mod_http2: using the new API calls to get rid of knowledge
about how the core handles conn_rec specifics.
Improvements in pollset stream handling to use less sets.
Using atomic read/writes instead of volatiles now.
Keeping a reserve of "transit" pools and bucket_allocs for
use on secondary connections to avoid repeated setup/teardowns.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899032 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898686 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
If ap_discard_request_body() sets AP_CONN_CLOSE by itself it simplifies and
allows to consolidate end_output_stream() and error_output_stream().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898683 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
*) core/mpm_preform: do not invoke the fancy new child_stopping/stopped
hooks when invoked from a signal handler. This is a stopgap to some
strange behaviour in need of some deeper insight.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898418 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898381 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
stopped all processing in a child process. This is when all running
threads shall be stopped and joined.
[Stefan Eissing]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898369 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898317 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
called from within ap_varbuf_strmemcat().
Moreover, 2nd parameter should be the minimum total new length, not
the amount of the growth. So this call is likely to be a no-op.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898286 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
to stabilize CI tests again. Previous revision of trunk has been copied
to branches/trunk-ssl-handshake-unblocking to make those into a PR where
changes can be discussed and tested separately.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897760 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
For completness, and possibly to ease backport to 2.4.x for MPM winnt.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897691 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897689 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Don't stderr printf the "stat" and "failed" results from the previous
apr_app_initialize() call for an error in ap_thread_main_create().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897680 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Possibly(?) pcre2_match() can modifiy the given pcre2_match_data and invalidate
the old ovector, be safe and fetch it after.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897651 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
If APR_POLLEXCL is available, use it to prevent the thundering
herd issue. The listening sockets are potentially polled by all
the children at the same time, when new connections arrive this
avoids all of them to be woken up while most would get EAGAIN
on accept().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897551 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897543 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897472 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897462 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897461 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897460 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897459 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897424 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
non blocking behaviour is requested.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897423 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897388 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897386 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
of support being implicit. Pass the desired sense depending on the state,
no longer default to write.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897385 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897351 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
CONN_STATE_READ_REQUEST_LINE phase, in addition to the existing
CONN_STATE_WRITE_COMPLETION phase. Update mod_ssl to perform non blocking
TLS handshakes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897281 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897273 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897263 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897261 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897260 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
#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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897250 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
limits.
Don't write to pmatch[nlimit:] when ncaps > nlimit, rc should not exceed nmatch
either as before r1897244.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897248 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897244 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897241 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897240 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
path in the DirectoryMatch and LocationMatch directives. This allows
modules like mod_dav to map URLs to URL spaces or to directories on
the filesystem.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897156 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now with a shorter epilogue.
Dump of assembler code for function ap_cstr_casecmp:
0x0000000000049fd0 <+0>: xor %edx,%edx
0x0000000000049fd2 <+2>: lea 0x3d567(%rip),%r8 # 0x87540 <ucharmap>
0x0000000000049fd9 <+9>: nopl 0x0(%rax)
0x0000000000049fe0 <+16>: movzbl (%rsi,%rdx,1),%eax
0x0000000000049fe4 <+20>: movzbl (%r8,%rax,1),%ecx
0x0000000000049fe9 <+25>: movzbl (%rdi,%rdx,1),%eax
0x0000000000049fed <+29>: add $0x1,%rdx
0x0000000000049ff1 <+33>: movzbl (%r8,%rax,1),%eax
0x0000000000049ff6 <+38>: sub %ecx,%eax
0x0000000000049ff8 <+40>: jne 0x49ffe <ap_cstr_casecmp+46>
0x0000000000049ffa <+42>: test %ecx,%ecx
0x0000000000049ffc <+44>: jne 0x49fe0 <ap_cstr_casecmp+16>
0x0000000000049ffe <+46>: ret
End of assembler dump.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897106 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This ones have a shorter prologue (-O2 still).
Dump of assembler code for function ap_cstr_casecmp:
0x0000000000049fd0 <+0>: xor %edx,%edx
0x0000000000049fd2 <+2>: lea 0x3d567(%rip),%r8 # 0x87540 <ucharmap>
0x0000000000049fd9 <+9>: nopl 0x0(%rax)
0x0000000000049fe0 <+16>: movzbl (%rdi,%rdx,1),%eax
0x0000000000049fe4 <+20>: movzbl (%rsi,%rdx,1),%ecx
0x0000000000049fe8 <+24>: add $0x1,%rdx
0x0000000000049fec <+28>: movzbl (%r8,%rax,1),%eax
0x0000000000049ff1 <+33>: movzbl (%r8,%rcx,1),%ecx
0x0000000000049ff6 <+38>: cmp %ecx,%eax
0x0000000000049ff8 <+40>: jne 0x49ffe <ap_cstr_casecmp+46>
0x0000000000049ffa <+42>: test %eax,%eax
0x0000000000049ffc <+44>: jne 0x49fe0 <ap_cstr_casecmp+16>
0x0000000000049ffe <+46>: sub %ecx,%eax
0x000000000004a000 <+48>: ret
End of assembler dump.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897105 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new versions [1] compile to a shorter/faster assembly than the previous
ones [2], no functionnal change.
[1] ap_cstr_casecmp() after this commit:
Dump of assembler code for function ap_cstr_casecmp:
0x0000000000049fc0 <+0>: movzbl (%rdi),%eax
0x0000000000049fc3 <+3>: movzbl (%rsi),%edx
0x0000000000049fc6 <+6>: lea 0x3d573(%rip),%r8 # 0x87540 <ucharmap>
0x0000000000049fcd <+13>: movzbl (%r8,%rax,1),%eax
0x0000000000049fd2 <+18>: movzbl (%r8,%rdx,1),%ecx
0x0000000000049fd7 <+23>: cmp %ecx,%eax
0x0000000000049fd9 <+25>: jne 0x49ffe <ap_cstr_casecmp+62>
0x0000000000049fdb <+27>: xor %edx,%edx
0x0000000000049fdd <+29>: jmp 0x49ffa <ap_cstr_casecmp+58>
0x0000000000049fdf <+31>: nop
0x0000000000049fe0 <+32>: add $0x1,%rdx
0x0000000000049fe4 <+36>: movzbl (%rdi,%rdx,1),%eax
0x0000000000049fe8 <+40>: movzbl (%rsi,%rdx,1),%ecx
0x0000000000049fec <+44>: movzbl (%r8,%rax,1),%eax
0x0000000000049ff1 <+49>: movzbl (%r8,%rcx,1),%ecx
0x0000000000049ff6 <+54>: cmp %ecx,%eax
0x0000000000049ff8 <+56>: jne 0x49ffe <ap_cstr_casecmp+62>
0x0000000000049ffa <+58>: test %eax,%eax
0x0000000000049ffc <+60>: jne 0x49fe0 <ap_cstr_casecmp+32>
0x0000000000049ffe <+62>: sub %ecx,%eax
0x000000000004a000 <+64>: ret
End of assembler dump.
[2] ap_cstr_casecmp() before this commit:
Dump of assembler code for function ap_cstr_casecmp:
0x000000000004a000 <+0>: movzbl (%rdi),%eax
0x000000000004a003 <+3>: movzbl (%rsi),%edx
0x000000000004a006 <+6>: lea 0x3d533(%rip),%r8 # 0x87540 <ucharmap>
0x000000000004a00d <+13>: mov %rdi,%r9
0x000000000004a010 <+16>: mov %rax,%rcx
0x000000000004a013 <+19>: movswl (%r8,%rdx,2),%edx
0x000000000004a018 <+24>: movswl (%r8,%rax,2),%eax
0x000000000004a01d <+29>: sub %edx,%eax
0x000000000004a01f <+31>: jne 0x4a052 <ap_cstr_casecmp+82>
0x000000000004a021 <+33>: mov $0x1,%edx
0x000000000004a026 <+38>: test %ecx,%ecx
0x000000000004a028 <+40>: je 0x4a052 <ap_cstr_casecmp+82>
0x000000000004a02a <+42>: nopw 0x0(%rax,%rax,1)
0x000000000004a030 <+48>: movzbl (%r9,%rdx,1),%eax
0x000000000004a035 <+53>: movzbl (%rsi,%rdx,1),%ecx
0x000000000004a039 <+57>: add $0x1,%rdx
0x000000000004a03d <+61>: mov %rax,%rdi
0x000000000004a040 <+64>: movswl (%r8,%rcx,2),%ecx
0x000000000004a045 <+69>: movswl (%r8,%rax,2),%eax
0x000000000004a04a <+74>: sub %ecx,%eax
0x000000000004a04c <+76>: jne 0x4a052 <ap_cstr_casecmp+82>
0x000000000004a04e <+78>: test %edi,%edi
0x000000000004a050 <+80>: jne 0x4a030 <ap_cstr_casecmp+48>
0x000000000004a052 <+82>: ret
End of assembler dump.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897101 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896505 13f79535-47bb-0310-9956-ffa450edef68
|