summaryrefslogtreecommitdiffstats
path: root/modules/http2 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mod_proxy_http2: ap_proxy_determine_connection()'s given &url is in/out.Yann Ylavic2024-06-261-1/+2
| | | | | | | | | * modules/http2/mod_proxy_http2.c(proxy_http2_handler): Restart from the original URL on reconnect. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918627 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: early exit if bb is nullEric Covener2024-06-241-0/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918548 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,mod_http2,mod_status: Follow up to r1918257: CONN_STATE_ASYNC_WAITIO.Yann Ylavic2024-06-211-10/+8
| | | | | | | | | | | | | | | | 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-113-34/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Follow up to r1918098 (and r1918022): Push missing changes.Yann Ylavic2024-06-012-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918099 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event, mod_status: Separate processing and write completion queues.Yann Ylavic2024-06-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Follow up to r1918022: MMN minor bump and checks for the new conn_state_e ↵Yann Ylavic2024-05-293-1/+13
| | | | | | aliases' usability. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918035 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,core: Handle async POLLIN/POLLOUT in CONN_STATE_PROCESS state.Yann Ylavic2024-05-281-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* *) mod_http2: sync with module's github.Stefan Eissing2024-05-277-13/+86
| | | | | | | | | | | | | | - 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918003 13f79535-47bb-0310-9956-ffa450edef68
* bail after too many failed readsEric Covener2024-04-033-3/+9
| | | | | | | | Submitted By: icing git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916771 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: v2.0.26 with the following fixes:Stefan Eissing2024-01-174-4/+14
| | | | | | | | | | | - Fixed `Date` header on requests upgraded from HTTP/1.1 (h2c). Fixes <https://github.com/icing/mod_h2/issues/272>. - Fixed small memory leak in h2 header bucket free. Thanks to Michael Kaufmann for finding this and providing the fix. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915281 13f79535-47bb-0310-9956-ffa450edef68
* * modules/http2/h2_ws.c: Fix comment, no functional change. [skip ci]Joe Orton2023-10-181-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913078 13f79535-47bb-0310-9956-ffa450edef68
* Fix h2 build broken in r1913019:Joe Orton2023-10-162-1/+5
| | | | | | | | | * modules/http2: Make WebSockets support conditional also on APR 1.7.x since apr_encode.h is required. Restore #include "apr_encode.h" removed in previous commit. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913023 13f79535-47bb-0310-9956-ffa450edef68
* Further h2 compile fixes:Joe Orton2023-10-162-1/+2
| | | | | | | | | | * modules/http2/h2_session.c (h2_session_start): Restrict WebSockets options handling to with-WS builds. * modules/http2/h2_ws.c: Don't include apr_encode.h (not used). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913019 13f79535-47bb-0310-9956-ffa450edef68
* * modules/http2: Fill in APLOGNO.Joe Orton2023-10-161-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913007 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: enable WebSockets on when compiling against aStefan Eissing2023-10-161-1/+3
| | | | | | | | | recent enough nghttp2 version. [Joe Orton] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913005 13f79535-47bb-0310-9956-ffa450edef68
* * mod_http2: improved early cleanup of streams.Stefan Eissing2023-10-164-7/+42
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912999 13f79535-47bb-0310-9956-ffa450edef68
* DOXYGEN has nothing to do here, just remove this strange "#if defined(DOXYGEN)"Christophe Jaillet2023-10-011-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912663 13f79535-47bb-0310-9956-ffa450edef68
* Slightly optimize h2_mplx_c1_streams_do().Christophe Jaillet2023-10-011-2/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912662 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fixed a compile time issue for Windows builds.Stefan Eissing2023-09-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912415 13f79535-47bb-0310-9956-ffa450edef68
* * mod_http2: fixed a bug in handling of stream timeouts.Stefan Eissing2023-09-185-1/+49
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912385 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_proxy_http2: fix `X-Forward-Host` header to carry the correct value.Stefan Eissing2023-09-081-10/+10
| | | | | | | | Fixed PR66752. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912180 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_proxy_http2: improved error handling on connection errors whileStefan Eissing2023-08-282-4/+20
| | | | | | | | response is already underway. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911964 13f79535-47bb-0310-9956-ffa450edef68
* Fix missing break in config settings, code styleStefan Eissing2023-08-282-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911961 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: sync with github versionStefan Eissing2023-08-166-9/+29
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911720 13f79535-47bb-0310-9956-ffa450edef68
* HTTP/2, websocketsStefan Eissing2023-08-145-11/+24
| | | | | | | | | | | | | - provide "Connection" header in internal Upgrade request - set input notification if input is already available when stream processing is started - add optional function in mod_http2.h to use instead of ap_get_pollfd_from_conn() in older servers with a new mod_http2 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911650 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: Fix reporting of `Total Accesses` in server-status to not countStefan Eissing2023-07-262-15/+0
| | | | | | | | HTTP/2 requests twice. Fixes PR 66801. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911291 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: add aplogno where makefile did not detect it missing?Stefan Eissing2023-06-291-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910688 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: when failing a request, make sure the request_rec fieldsStefan Eissing2023-06-291-1/+15
| | | | | | | | | | | are populated (best effort) for the response generation since this might access fields in there. Respect a http_status already assigned during stream processing for error generation. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910686 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: move get_pollfd_from_conn hook outside the HAS_RESPONSE_BUCKET partStefan Eissing2023-06-291-27/+31
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910685 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1910656: Fix dumplicate APLOGNO.Yann Ylavic2023-06-281-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910664 13f79535-47bb-0310-9956-ffa450edef68
* lognos for the new debugsStefan Eissing2023-06-281-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910658 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: new directive `H2ProxyRequests on|off` to enable handlingStefan Eissing2023-06-283-2/+58
| | | | | | | | | | | 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/trunk@1910656 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: optimization for c1 output passing when collectingStefan Eissing2023-06-281-4/+11
| | | | | | | | next DATA frame for a response. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910648 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: adding checks for websocket support on platform andStefan Eissing2023-06-217-44/+106
| | | | | | | | | | | server versions. Give error message accordingly when trying to enable websockets in unsupported configurations. Add test and code to check the, finally selected, server of a request_rec for websocket support or 501 the request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910535 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: added support for bootstrapping WebSockets via HTTP/2, asStefan Eissing2023-06-2023-69/+675
| | | | | | | | | | | | | | | 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
* * mod_htt2: fixed an inconsistency in main connection io state after the ↵Stefan Eissing2023-06-161-2/+1
| | | | | | | | | | connection write encountered an error. Related to PR 66649. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910441 13f79535-47bb-0310-9956-ffa450edef68
* update log tags, as usualStefan Eissing2023-06-151-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910426 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fixed a bug that could lead to a crash in main connectionStefan Eissing2023-06-136-12/+97
| | | | | | | | | | | output handling. This occured only when the last request on a HTTP/2 connection had been processed and the session decided to shut down. This could lead to an attempt to send a final GOAWAY while the previous write was still in progress. See PR 66646. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910386 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fixed a bug in flushing pending data on an already closedStefan Eissing2023-06-091-1/+4
| | | | | | | | | connection that could lead to a busy loop, preventing the HTTP/2 session to close down successfully. Fixed PR 66624. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910331 13f79535-47bb-0310-9956-ffa450edef68
* * mod_proxy_http2: fixed using the wrong "bucket_alloc" from the backendStefan Eissing2023-06-017-77/+113
| | | | | | | | | | | | | | | | | | connection when sending data on the frontend one. This caused crashes or infinite loops in rare situations. * mod_proxy_http2: fixed a bug in retry/response handling that could lead to wrong status codes or HTTP messages send at the end of response bodies exceeding the announced content-length. * mod_proxy_http2: fix retry handling to not leak temporary errors. On detecting that that an existing connection was shutdown by the other side, a 503 response leaked even though the request was retried on a fresh connection. * mod_http2: fixed a bug that did cleanup of consumed and pending buckets in the wrong order when a bucket_beam was destroyed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910157 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_proxy_http2: fix retry handling to not leak temporary errors.Stefan Eissing2023-05-221-6/+3
| | | | | | | | | | On detecting that that an existing connection was shutdown by the other side, a 503 response leaked even though the request was retried on a fresh connection. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909989 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: avoid double chunked-encoding on internal redirects.Stefan Eissing2023-05-191-1/+1
| | | | | | | | PR 66597 [Yann Ylavic, Stefan Eissing] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909932 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: v2.0.15 with the following fixes and improvementsStefan Eissing2023-05-1214-68/+196
| | | | | | | | | | | | | | | | | | | | | | | - New directive 'H2EarlyHint name value' to add headers to a response, picked up already when a "103 Early Hints" response is sent. 'name' and 'value' must comply to the HTTP field restrictions. This directive can be repeated several times and header fields of the same names add. Sending a 'Link' header with 'preload' relation will also cause a HTTP/2 PUSH if enabled and supported by the client. - Fixed an issue where requests were not logged and accounted in a timely fashion when the connection returns to "keepalive" handling, e.g. when the request served was the last outstanding one. This led to late appearance in access logs with wrong duration times reported. - Accurately report the bytes sent for a request in the '%O' Log format. This addresses #203, a long outstanding issue where mod_h2 has reported numbers over-eagerly from internal buffering and not what has actually been placed on the connection. The numbers are now the same with and without H2CopyFiles enabled. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909769 13f79535-47bb-0310-9956-ffa450edef68
* mod_proxy: Check for space/ctrls in nocanon path/urls before forwarding.Yann Ylavic2023-03-311-13/+18
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908827 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fixed a crash during connection termination. See PR 66539.Stefan Eissing2023-03-241-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908691 13f79535-47bb-0310-9956-ffa450edef68
* * Whitespace fixes. No functional change.Ruediger Pluem2023-03-221-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908628 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: Fix memory leak in calc_sha256_hash().Yann Ylavic2023-03-181-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908502 13f79535-47bb-0310-9956-ffa450edef68
* Do not double encode encoded slashesRuediger Pluem2023-03-131-2/+5
| | | | | | | | | | | | | | | | | | | | | In case that AllowEncodedSlashes is set to NoDecode do not double encode encoded slashes in the URL sent by the reverse proxy to the backend. * include/ap_mmn.h: Document the addition of ap_proxy_canonenc_ex to the API. * modules/proxy/mod_proxy.h: Declare ap_proxy_canonenc_ex and define flag values. * modules/proxy/proxy_util.c: Implement ap_proxy_canonenc_ex by modifying ap_proxy_canonenc accordingly and reimplement ap_proxy_canonenc to use ap_proxy_canonenc_ex with the appropriate flag. * modules/http2/mod_proxy_http2.c, modules/proxy/mod_proxy_*.c: Set the correct flag based on the AllowEncodedSlashes configuration and use ap_proxy_canonenc_ex instead of ap_proxy_canonenc. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908341 13f79535-47bb-0310-9956-ffa450edef68
* mod_proxy: Check the query-string for proxy-noencode too.Yann Ylavic2023-03-101-10/+10
| | | | | | | | Follow up to r1907972 and r1908095. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908257 13f79535-47bb-0310-9956-ffa450edef68