summaryrefslogtreecommitdiff
path: root/modules/http2
Commit message (Collapse)AuthorAgeFilesLines
* *) 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
* * modules/http2/mod_proxy_http2.c: Fix missing APLOGNO.Joe Orton2023-03-061-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908116 13f79535-47bb-0310-9956-ffa450edef68
* don't forward invalid query stringsEric Covener2023-03-051-0/+10
| | | | | | | Submitted by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908095 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_htt2: recent small improvements from the github/icing/mod_h2Stefan Eissing2023-03-053-2/+14
| | | | | | | | | - conditional use of ap_thread* to allow compilation on older versions - fixed checks on CONNECT requests git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908079 13f79535-47bb-0310-9956-ffa450edef68
* mod_proxy: Don't decode r->uri and reencode in r->filename for mapping=encoded.Yann Ylavic2023-03-021-0/+4
| | | | | | | | | | | | | | | | | | | Decoding was not done for mapping=servlet only (a subset), but overlooked for mapping=encoded. To avoid double-encoding in the canon_handler hook, use a new "proxy-noencode" (similarly to "proxy-nocanon") entry in r->notes. * proxy/mod_proxy.c(ap_proxy_trans_match): Set "proxy-noencode" in r->notes for PROXYPASS_MAP_ENCODED, and return DONE to avoid decoding in ap_process_request_internal(). * proxy/mod_proxy_http.c, proxy/mod_proxy_ajp.c, proxy/mod_proxy_wstunnel.c, proxy/mod_proxy_fcgi.c, proxy/mod_proxy_ajp.c, http2/mod_proxy_http2.c: Don't process the url through ap_proxy_canonenc() in canon_handler if "proxy-noencode" is set. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907972 13f79535-47bb-0310-9956-ffa450edef68
* Re-order the fields of 'struct h2_session_props' to avoid a hole and some ↵Christophe Jaillet2023-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | padding. On x86_64, this shrinks the size of the struct from 40 to 32 bytes. Before the patch, pahole states that: struct h2_session_props { int accepted_max; /* 0 4 */ int completed_max; /* 4 4 */ int emitted_count; /* 8 4 */ int emitted_max; /* 12 4 */ int error; /* 16 4 */ /* XXX 4 bytes hole, try to pack */ const char * error_msg; /* 24 8 */ unsigned int accepting:1; /* 32: 0 4 */ unsigned int shutdown:1; /* 32: 1 4 */ /* size: 40, cachelines: 1, members: 8 */ /* sum members: 28, holes: 1, sum holes: 4 */ /* sum bitfield members: 2 bits (0 bytes) */ /* padding: 4 */ /* bit_padding: 30 bits */ /* last cacheline: 40 bytes */ }; git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907756 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: new directive 'H2MaxDataFrameLen n' to limit the maximumStefan Eissing2023-02-166-6/+38
| | | | | | | | | | | | | amount of response body bytes put into a single HTTP/2 DATA frame. Setting this to 0 places no limit (but the max size allowed by the protocol is observed). The module, by default, tries to use the maximum size possible, which is somewhat around 16KB. This sets the maximum. When less response data is available, smaller frames will be sent. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907697 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: deny protocol upgrade if the request has a chunked-encoded body.Stefan Eissing2023-02-162-4/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907696 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: client resets of HTTP/2 streams led to unwanted 500 errorsStefan Eissing2023-01-181-1/+1
| | | | | | | | | reported in access logs and error documents. The processing of the reset was correct, only unneccesary reporting was caused. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1906775 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_proxy_http2: apply the standard httpd content type handlingStefan Eissing2022-12-171-0/+5
| | | | | | | | | to responses from the backend, as other proxy modules do. Fixes PR 66391. Thanks to Jérôme Billiras for providing the patch. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1906051 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: field values (headers and trailers) are stripped ofStefan Eissing2022-10-228-101/+95
| | | | | | | | | | | | | leading/trailing whitespace (space +htab) before being processed or send in a response. This is compatible behaviour to HTTP/1.1 parsers that strip incoming headers of such characters. [Stefan Eissing] - removed intermittent "H2HeaderStrictness" directive again. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904777 13f79535-47bb-0310-9956-ffa450edef68
* mod_http2: resolving duplicate log tag in #if/#else code copies.Stefan Eissing2022-10-141-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904590 13f79535-47bb-0310-9956-ffa450edef68
* aplogno should be called aplogyesStefan Eissing2022-10-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904561 13f79535-47bb-0310-9956-ffa450edef68
* Sync with v2.0.10 from github:Stefan Eissing2022-10-1121-446/+602
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extensive testing in production done by Alessandro Bianchi (@alexskynet) on the v2.0.x versions for stability. Many thanks! * refactored stream response handling to reflect the different phases (response/data/trailers) more clearly and help resolving cpu busy loops. * Adding more negative tests for handling of errored responses to cover edge cases. * mod_http2: fixed handling of response where neiter an EOS nor an ERROR was received as a cause to reset the stream. * mod_proxy_http2: generating error buckets for fault response bodies, to signal failure to fron when response header were already sent. v2.0.9 -------------------------------------------------------------------------------- * Fixed a bug where errors during reponse body handling did not lead to a proper RST_STREAM. Instead processing went into an infinite loop. Extended test cases to catch this condition. v2.0.8 -------------------------------------------------------------------------------- * Delaying input setup of a stream just before processing starts. This allows any EOS indicator arriving from the client before that to take effect. Without knowing that a stream has no input, internal processing has to simulate chunked encoding. This is not wrong, but somewhat more expensive and mod_security has been reported to be allergic to seeing 'chunked' on some requests. See <https://bz.apache.org/bugzilla/show_bug.cgi?id=66282>. * mod_proxy_http2: fixed #235 by no longer forwarding 'Host:' header when request ':authority' is known. Improved test case that did not catch that the previous 'fix' was incorrect. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904522 13f79535-47bb-0310-9956-ffa450edef68
* Resolving a duplicate log tag after ressurecting h2_headers.c for 2.4.x compat.Stefan Eissing2022-10-061-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904424 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: synchronization with github sources.Stefan Eissing2022-09-2725-97/+1914
| | | | | | | | | Building in trunk and against 2.4.x is now supported via AP_HAS_RESPONSE_BUCKETS defines. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904305 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: use proper apr_time_t where it is due, no (int) casting.Stefan Eissing2022-09-271-4/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904299 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: type adjustments and castings for ↵Stefan Eissing2022-09-2714-233/+118
| | | | | | int/apr_uint32_t/apr_size_t/apr_off_t. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904297 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: new directive "H2HeaderStrictness" to control the complianceStefan Eissing2022-09-2618-278/+359
| | | | | | | | | | | | | | | | level of header checks as defined in the HTTP/2 RFCs. Default is 7540. 9113 activates the checks for forbidden leading/trailing whitespace in field values (available from nghttp2 v1.50.0 on). - source sync with github version - fix for keepalive idle wait in mpm_worker setup - ensuring EOS when secondary connection has been handled - fixed race in late input EOS arrival when stream was already scheduled for execution. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904269 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: removing bucket splitting into an extra recv brigade.Stefan Eissing2022-09-212-71/+3
| | | | | | | | | | | buckets are always received as a whole now, even if the total size exceeds the receivers specified length. This simplifies the internal handling and, since these buckets already exist, lead to less memory consumption overall. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904189 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_proxy_http2: use only the ':authority' header to forward 'Host'Stefan Eissing2022-09-201-2/+9
| | | | | | | | | information to a backend. Deduce ':authority' from what the client sent when 'ProxyPreserveHost' is on. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904164 13f79535-47bb-0310-9956-ffa450edef68
* * http2_get_num_workers is not deprecated.Ruediger Pluem2022-08-171-3/+3
| | | | | | | Hence move it out of the deprecation section git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1903478 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fixed trailer handling. Empty response bodiesStefan Eissing2022-07-022-31/+58
| | | | | | | | | | prevented trailers from being sent to a client. See <https://github.com/icing/mod_h2/issues/233> for how this affected gRPC use. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902409 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: remove the workers pool from APR_POOL_DEBUGStefan Eissing2022-06-201-4/+3
| | | | | | | | logging now that h2_workers is opaque. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902095 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: init local var since write in loop may be buypassed.Stefan Eissing2022-06-201-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902082 13f79535-47bb-0310-9956-ffa450edef68
* * Use s directly like in the other ap_log_error callsRuediger Pluem2022-06-201-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902081 13f79535-47bb-0310-9956-ffa450edef68
* * workers is not always initialized hereRuediger Pluem2022-06-201-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902080 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: new implementation of h2 worker pool.Stefan Eissing2022-06-178-425/+539
| | | | | | | | | | | | | - O(1) cost at registration of connection processing producers - no limit on registered producers - join of ongoing work on unregister - callbacks to unlink dependencies into other h2 code - memory cleanup on workers deactivation (on idle timeouts) - idle_limit as apr_time_t instead of seconds git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902005 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fix an edge case in h2_fifo_remove,Stefan Eissing2022-06-173-19/+34
| | | | | | | | | improve c1 connection flushing, fix an UAF in recycling transit pools. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1902004 13f79535-47bb-0310-9956-ffa450edef68
* Fix a typoChristophe Jaillet2022-05-081-1/+1
| | | | | | [skip ci] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900692 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: remove unused and insecure code. Fixes PR66037.Stefan Eissing2022-04-282-24/+0
| | | | | | | | Thanks to Ronald Crane (Zippenhop LLC) for reporting this. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900356 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: clear the h2 worker slot connection early to avoidStefan Eissing2022-04-211-5/+7
| | | | | | | | any race in slot updates after the connection has been handled. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900104 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fix edge case in removal of entriesStefan Eissing2022-04-211-1/+3
| | | | | | | | in a h2_fifo. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900102 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: make APLOGNO check happy with line continuation.Stefan Eissing2022-04-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900037 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: using new session ids also in logging for connectionStefan Eissing2022-04-194-2/+10
| | | | | | | | contexts and bucket beams. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900031 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: use new ap_sb_get_child_thread() to get child_numStefan Eissing2022-04-197-90/+92
| | | | | | | | | and create unique h2 session identifiers in logging that stay unique among re-activations of the master connection. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900030 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: use the new REQUEST buckets to forward requestStefan Eissing2022-04-1317-292/+349
| | | | | | | | | on secondary connections. Use the now generic ap_process_connection() in h2 workers to process those. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899802 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: some minor tweaks to connection mood updates.Stefan Eissing2022-04-081-42/+41
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899661 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: use the new RESPONSE buckets introduced in r1899648.Stefan Eissing2022-04-0723-1145/+211
| | | | | | | | | | This replaces the internal H2_HEADERS bucket, removing its source file and also obsoletes any interim response parsing needs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899649 13f79535-47bb-0310-9956-ffa450edef68
* *) core/mod_http/mod_http2:Stefan Eissing2022-04-044-221/+36
| | | | | | | | | | | | | | | | | | | - 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
* *) mod_http2: in a recent change, code was removed that prevented connectionsStefan Eissing2022-03-241-5/+21
| | | | | | | | | with many parallel streams to stall. Re-added that, slightly improved and with a comment that explains the need for future humans. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899169 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: fixed a possible concurrency issue withStefan Eissing2022-03-242-56/+83
| | | | | | | | | | | registering h2_mplx at h2_workers. Improved h2_fifo internals efficiency inspired by ap_fdqueue. Made 711 tests repeatable. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899168 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: removed extra h2_mplx_worker_c2_done() argStefan Eissing2022-03-233-69/+38
| | | | | | | | | to retrive another c2 for processing. Just added complexity without measurable benefits. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899149 13f79535-47bb-0310-9956-ffa450edef68
* *) mod_http2: when using a pipe for input signalling, alwaysStefan Eissing2022-03-213-1/+33
| | | | | | | | write to it on sending buckets, not only when it was empty. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899108 13f79535-47bb-0310-9956-ffa450edef68