summaryrefslogtreecommitdiffstats
path: root/server (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add Multipath TCP (MPTCP) support (Proxy)Joe Orton2024-09-121-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension that enables a TCP connection to use different paths. Multipath TCP has been used for several use cases. On smartphones, MPTCP enables seamless handovers between cellular and Wi-Fi networks while preserving established connections. This use-case is what pushed Apple to use MPTCP since 2013 in multiple applications [2]. On dual-stack hosts, Multipath TCP enables the TCP connection to automatically use the best performing path, either IPv4 or IPv6. If one path fails, MPTCP automatically uses the other path. To benefit from MPTCP, both the client and the server have to support it. Multipath TCP is a backward-compatible TCP extension that is enabled by default on recent Linux distributions (Debian, Ubuntu, Redhat, ...). Multipath TCP is included in the Linux kernel since version 5.6 [3]. To use it on Linux, an application must explicitly enable it when creating the socket. No need to change anything else in the application. Adding the possibility to create MPTCP sockets would thus be a really fine addition to httpd, by allowing clients to make use of their different interfaces. This patch introduces the possibilty to connect to backend servers using MPTCP. Note however that these changes are only available on Linux, as IPPROTO_MPTCP is Linux specific for the time being. For proxies, we can connect using MPTCP by passing the \"multipathtcp\" parameter: ProxyPass \"/example\" \"http://backend.example.com\" multipathtcp=On We then store this information in the worker and create sockets appropriately according to this value. Link: https://www.rfc-editor.org/rfc/rfc8684.html [1] Link: https://www.tessares.net/apples-mptcp-story-so-far/ [2] Link: https://www.mptcp.dev [3] Add Multipath TCP (MPTCP) support (Core) Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension that enables a TCP connection to use different paths. Multipath TCP has been used for several use cases. On smartphones, MPTCP enables seamless handovers between cellular and Wi-Fi networks while preserving established connections. This use-case is what pushed Apple to use MPTCP since 2013 in multiple applications [2]. On dual-stack hosts, Multipath TCP enables the TCP connection to automatically use the best performing path, either IPv4 or IPv6. If one path fails, MPTCP automatically uses the other path. To benefit from MPTCP, both the client and the server have to support it. Multipath TCP is a backward-compatible TCP extension that is enabled by default on recent Linux distributions (Debian, Ubuntu, Redhat, ...). Multipath TCP is included in the Linux kernel since version 5.6 [3]. To use it on Linux, an application must explicitly enable it when creating the socket. No need to change anything else in the application. Adding the possibility to create MPTCP sockets would thus be a really fine addition to httpd, by allowing clients to make use of their different interfaces. This patch introduces the possibility to listen with MPTCP sockets. Note however that these changes are only available on Linux, as IPPROTO_MPTCP is Linux specific for the time being. To do so, we extended the Listen directive to include a \"multipathtcp\" option, allowing to create MPTCP sockets instead of regular TCP ones: Listen 80 options=multipathtcp We then store this information in flags for the listen directive and create sockets appropriately according to this value. Link: https://www.rfc-editor.org/rfc/rfc8684.html [1] Link: https://www.tessares.net/apples-mptcp-story-so-far/ [2] Link: https://www.mptcp.dev [3] Submitted by: Aperence <anthony.doeraene hotmail.com> Github: closes #476 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920586 13f79535-47bb-0310-9956-ffa450edef68
* Windows: fix "Include" of UNC paths Eric Covener2024-09-111-1/+1
| | | | | | | ... by making UNCList EXEC_ON_READ (since Include is EXEC_ON_READ) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920564 13f79535-47bb-0310-9956-ffa450edef68
* ap_log_error: Include apu_version header to pick up apr-utilGraham Leggett2024-08-291-0/+1
| | | | | | | version number. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920273 13f79535-47bb-0310-9956-ffa450edef68
* ap_log_error: Include text strings from apr-util in additionGraham Leggett2024-08-191-0/+15
| | | | | | | to apr. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920013 13f79535-47bb-0310-9956-ffa450edef68
* core: ap_location_walk() does not deal with the filesystemYann Ylavic2024-07-121-1/+1
| | | | | | | | | | | | So it shouldn't merge slashes according to filesystem rules. * server/request.c(ap_location_walk): Use ap_no2slash_ex(,0) instead of ap_no2slash() to ignore filesystem specifics. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919165 13f79535-47bb-0310-9956-ffa450edef68
* factor out IS_SLASH, perdir fixEric Covener2024-06-261-21/+10
| | | | | | | in per-dir, the filename will be internally redirected, so / is OK too. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918651 13f79535-47bb-0310-9956-ffa450edef68
* add ap_set_content_type_ex to differentiateEric Covener2024-06-242-2/+2
| | | | | | | trusted sources git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918551 13f79535-47bb-0310-9956-ffa450edef68
* add UNCList directive on Windows Eric Covener2024-06-241-0/+101
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918549 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event: Follow up to r1918482: CONN_STATE_LINGER* are not the last anymore.Yann Ylavic2024-06-211-8/+15
| | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918491 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event: Follow up to r1918482: CONN_STATE_ASYNC_WAITIO > CONN_STATE_LINGER.Yann Ylavic2024-06-211-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918483 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,mod_http2,mod_status: Follow up to r1918257: CONN_STATE_ASYNC_WAITIO.Yann Ylavic2024-06-211-42/+40
| | | | | | | | | | | | | | | | 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). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918482 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,mod_http2: Keep compatibility with CONN_STATE_PROCESSING + OKYann Ylavic2024-06-111-75/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918257 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event, mod_status: Separate processing and write completion queues.Yann Ylavic2024-06-013-44/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918098 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event: Don't spam with "Stopping process due to MaxConnectionsPerChild"Yann Ylavic2024-05-311-4/+2
| | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918078 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,core: Handle async POLLIN/POLLOUT in CONN_STATE_PROCESS state.Yann Ylavic2024-05-283-111/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918022 13f79535-47bb-0310-9956-ffa450edef68
* On Linux use the real thread id via gettid() in error logging,Joe Orton2024-05-081-1/+5
| | | | | | | | | | | | | | | 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(). Github: closes #443 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1917578 13f79535-47bb-0310-9956-ffa450edef68
* * server/core.c (set_override): Catch errors returned byJoe Orton2024-04-161-2/+4
| | | | | | | | | | set_allow_opts() for a parsing fail in an Options= argument. Submitted by: Zhou Qingyang <zhou1615 umn.edu> Github: closes #310 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1917017 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,mpm_worker: Comment about pollset sizing when APR_POLLSET_WAKEABLE.Yann Ylavic2024-04-122-2/+8
| | | | | | | | Follow up to r1916925 and r1916926. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916929 13f79535-47bb-0310-9956-ffa450edef68
* mpm_worker: Fix AH00045 about children processes not terminating timely.Yann Ylavic2024-04-121-18/+32
| | | | | | | | | | | | | | | | | | | * 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916926 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event: Simplify pollset "good methods" vs APR_POLLSET_WAKEABLE.Yann Ylavic2024-04-121-13/+11
| | | | | | | | | | | | | | | | | * 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916925 13f79535-47bb-0310-9956-ffa450edef68
* shutdown carefully when threads don't startEric Covener2024-03-132-3/+38
| | | | | | | Submitted By: ylavic, covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916267 13f79535-47bb-0310-9956-ffa450edef68
* use graceful exit if lister startedEric Covener2024-03-121-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916243 13f79535-47bb-0310-9956-ffa450edef68
* event: avoid possible hang in clean_child_exitEric Covener2024-03-111-0/+1
| | | | | | | | | | | | | If the pthread_create failure isn't on the first worker thread, another one is likely to hold the queue mutex already. The cleanup of pchild will try to cleanup the queue and block on destroying the condition. ST_UNGRACEFUL as we have no listener thread yet. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916241 13f79535-47bb-0310-9956-ffa450edef68
* * server/util_expr_parse.c (yyparse): Fix typo in comment.Joe Orton2024-02-021-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915543 13f79535-47bb-0310-9956-ffa450edef68
* Updated typo NWGNUmakefileRich Bowen2024-01-241-1/+1
| | | | | | | | | | | dependencies was spelled dependancies. Submitted by: StevenSedwick <133059415+StevenSedwick@users.noreply.github.com> Github: closes #382 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915380 13f79535-47bb-0310-9956-ffa450edef68
* regex: Add AP_REG_NOTEMPTY_ATSTART maching option.Yann Ylavic2024-01-161-0/+2
| | | | | | | | | | | | | | | * include/ap_mmn.h: Bump MMN minor. * include/ap_regex.h: Define AP_REG_NOTEMPTY_ATSTART bit. * server/util_pcre.c(ap_regexec_ex): Map AP_REG_NOTEMPTY_ATSTART to native PCRE_NOTEMPTY_ATSTART. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915268 13f79535-47bb-0310-9956-ffa450edef68
* regex: Add ap_regexec_ex() which can take a starting offset to match from.Yann Ylavic2024-01-161-8/+23
| | | | | | | | | | | | | | | | | * include/ap_mmn.h: Bump MMN minor. * include/ap_regex.h: Declare ap_regexec_ex(). * server/util_pcre.c(ap_regexec, ap_regexec_len, ap_regexec_ex): Reuse existing ap_regexec_len() code to implement ap_regexec_ex() where the offset is given instead of zero, then implement ap_regexec{,len}() in terms of ap_regexec_ex(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915267 13f79535-47bb-0310-9956-ffa450edef68
* util_filter: More useful logging for brigade setaside/reinstate/adopt.Yann Ylavic2023-07-071-37/+49
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910846 13f79535-47bb-0310-9956-ffa450edef68
* http_protocol: make request processing more robust for incomplete dataStefan Eissing2023-06-211-0/+7
| | | | | | | | | - Length restrictions may error on a too long request path, leaving the uri unset. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910533 13f79535-47bb-0310-9956-ffa450edef68
* *) http_protocol: if there is a request and an error bucket in the inputStefan Eissing2023-06-211-62/+71
| | | | | | | | | | brigade, always process the request bucket first. This gives the proper context in which to evaluate the error bucket in. Some error access r->method, for example, in their response body. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910530 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: added support for bootstrapping WebSockets via HTTP/2, asStefan Eissing2023-06-201-0/+30
| | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910507 13f79535-47bb-0310-9956-ffa450edef68
* * Fix copy and paste errorRuediger Pluem2023-06-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910324 13f79535-47bb-0310-9956-ffa450edef68
* When we are at flush_max_threshold and the next bucket is a metadata (i.e. ↵Christophe Jaillet2023-05-211-30/+30
| | | | | | | | next->length == 0), we still need to re-check for flush_max_threshold and associated optimisation (is_in_memory_bucket()) when we process this metadata bucket in the next iteration of the loop. Follow-up to r1892450. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909966 13f79535-47bb-0310-9956-ffa450edef68
* Make sources build with latest clang versionStefan Eissing2023-04-275-5/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909450 13f79535-47bb-0310-9956-ffa450edef68
* core: Add the token_checker hook, that allows authentication to takeGraham Leggett2023-04-251-0/+29
| | | | | | | | place using mechanisms other than username/password, such as bearer tokens. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909409 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1909356: c89/style fix.Yann Ylavic2023-04-231-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909368 13f79535-47bb-0310-9956-ffa450edef68
* core: Restore original regex value when nesting Location,Graham Leggett2023-04-221-0/+14
| | | | | | | Directory and File directives. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909356 13f79535-47bb-0310-9956-ffa450edef68
* core: Be explicit if an enclosing directive contains a path or aGraham Leggett2023-04-141-25/+23
| | | | | | | regex. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909135 13f79535-47bb-0310-9956-ffa450edef68
* Fix possible NULL pointer dereference casued by apreq_param_make()Giovanni Bechis2023-04-055-0/+22
| | | | | | | | | | | | | | | The function apreq_param_make() will return NULL on failure. However NULL check are forgetten before derenference, which could lead to NULL pointer dereference. Adding NULL check to all use of apreq_param_make(). Submitted by: Zhou Qingyang <zhou1615@umn.edu> Github: closes #303 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908981 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event: useful APLOG_DEBUG messages.Yann Ylavic2023-04-011-8/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908883 13f79535-47bb-0310-9956-ffa450edef68
* Fix a possible null pointer dereference in ap_expr_parse()Giovanni Bechis2023-03-281-1/+4
| | | | | | | | | | | | | | | | | In ap_expr_parse(), ap_expr_yylex_init() will return 1 on failure, and ctx.scanner will remain NULL. However the return value of ap_expr_yylex_init() is not checked, and there is a dereference of ctx.scanner in following function ap_expr_yyset_extra(), which may lead to NULL pointer dereference. Fix this bug by adding return value check of ap_expr_yylex_init. Submitted by: Zhou Qingyang <zhou1615@umn.edu> Github: closes #308 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908772 13f79535-47bb-0310-9956-ffa450edef68
* check apreq_cookie_make return valueGiovanni Bechis2023-03-231-0/+4
| | | | | | | Github: closes #302 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908673 13f79535-47bb-0310-9956-ffa450edef68
* util_time: Follow up to r1908380 and r1908389: apr_strings.h not needed anymore.Yann Ylavic2023-03-201-1/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908556 13f79535-47bb-0310-9956-ffa450edef68
* core: Follow up to r1908393: comment about where ap_server_conf is set.Yann Ylavic2023-03-151-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908406 13f79535-47bb-0310-9956-ffa450edef68
* core: Follow up to r1908393: ap_server_conf to NULL before ap_read_config().Yann Ylavic2023-03-141-0/+2
| | | | | | | | Just to be sure.. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908394 13f79535-47bb-0310-9956-ffa450edef68
* core: Set ap_server_conf ASAP.Yann Ylavic2023-03-142-4/+7
| | | | | | | | | | | | | * server/config.c(ap_read_config): Set ap_server_conf as soon as it exists (with defaults). * server/main.c(main): Now that ap_server_conf is set by ap_read_config(), just make sure it's not NULL afterward with an ap_assert()ion. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908393 13f79535-47bb-0310-9956-ffa450edef68
* log: Follow up to r1908388: ap_server_conf might be NULL.Yann Ylavic2023-03-141-3/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908390 13f79535-47bb-0310-9956-ffa450edef68
* util_time: Follow up to r1908380: Avoid apr_snprintf() like others.Yann Ylavic2023-03-141-6/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908389 13f79535-47bb-0310-9956-ffa450edef68
* core: Use the main ErrorLogFormat for ap_log_perror() and while loading vhosts.Yann Ylavic2023-03-142-1/+13
| | | | | | | | | | | | | | * server/core.c(create_core_server_config): Init sconf->error_log_format early so that it applies while the vhost is loading. * server/log.c(log_error_core): Get the core_server_config from the main server if no server/config is provided. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908388 13f79535-47bb-0310-9956-ffa450edef68
* util_time: Note/comments about ap_recent_ctime_ex() correctness wrt trailing \0Yann Ylavic2023-03-141-2/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908383 13f79535-47bb-0310-9956-ffa450edef68