[PATCH 03 of 14] Proxy: use zero Content-Length while discarding request body

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574630 -10800 # Sat Apr 20 03:57:10 2024 +0300 # Node ID c485429c713b5d24ba8329e95164b517cf8a1b87 # Parent 0946ec7c4a6a26fda6ed03cb1f1f877984ec5614 Proxy: use zero Content-Length while discarding request body. Previously, r->headers_in.con

[PATCH 00 of 14] request body discarding cleanup

2024-04-19 Thread Maxim Dounin
Hello! The following patch series is focused on various edge cases related to reading and discarding of a request body. Notably, it should be now safe (from the request body point of view) to configure complex processing for errors, such as 413 (Request Entity Too Large), including proxying, with

[PATCH 01 of 14] Reordered checks for Content-Length and Transfer-Encoding

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574627 -10800 # Sat Apr 20 03:57:07 2024 +0300 # Node ID 3c408152180f04a54c44d482cf1c9c52b63480d9 # Parent ccd7e4022a2498a930c9e0927a9820f7ea17ae13 Reordered checks for Content-Length and Transfer-Encoding. This ensures that r->headers_in.

[PATCH 02 of 14] HTTP/3: fixed handling of request body larger than Content-Length

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574628 -10800 # Sat Apr 20 03:57:08 2024 +0300 # Node ID 0946ec7c4a6a26fda6ed03cb1f1f877984ec5614 # Parent 3c408152180f04a54c44d482cf1c9c52b63480d9 HTTP/3: fixed handling of request body larger than Content-Length. Previously, 413 (Request

[PATCH 06 of 14] Request body: logging of timeouts

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574635 -10800 # Sat Apr 20 03:57:15 2024 +0300 # Node ID 4476851eed617ebc2c0125ab208c98d9634742e1 # Parent 7997083c8deb47dd84b2f2d323ac404d370d704a Request body: logging of timeouts. diff --git a/src/http/ngx_http_request_body.c b/src/http

[PATCH 05 of 14] Request body: provided log action for reading request body

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574634 -10800 # Sat Apr 20 03:57:14 2024 +0300 # Node ID 7997083c8deb47dd84b2f2d323ac404d370d704a # Parent e59f07d8682810caa6693f707928593651fb9038 Request body: provided log action for reading request body. diff --git a/src/http/ngx_http_

[PATCH 07 of 14] Request body: block reading when returning errors

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574637 -10800 # Sat Apr 20 03:57:17 2024 +0300 # Node ID 42c2333af8bacd65b50933119dcc47c9343f6cd2 # Parent 4476851eed617ebc2c0125ab208c98d9634742e1 Request body: block reading when returning errors. If reading is not blocked, additional cl

[PATCH 08 of 14] Request body: improved debug logging

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574638 -10800 # Sat Apr 20 03:57:18 2024 +0300 # Node ID 976af6df50499768d08b176e9ae0ec0e1096ae88 # Parent 42c2333af8bacd65b50933119dcc47c9343f6cd2 Request body: improved debug logging. diff --git a/src/http/ngx_http_request_body.c b/src/h

[PATCH 04 of 14] Reset c->log->action on redirect to a named location

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574632 -10800 # Sat Apr 20 03:57:12 2024 +0300 # Node ID e59f07d8682810caa6693f707928593651fb9038 # Parent c485429c713b5d24ba8329e95164b517cf8a1b87 Reset c->log->action on redirect to a named location. This matches what happens on internal

[PATCH 09 of 14] Request body: simplified error handling in HTTP/2

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574640 -10800 # Sat Apr 20 03:57:20 2024 +0300 # Node ID 20eed25e08bb2b46bd5deddba63f5b4d4779e4a4 # Parent 976af6df50499768d08b176e9ae0ec0e1096ae88 Request body: simplified error handling in HTTP/2. No functional changes. diff --git a/src

[PATCH 10 of 14] Request body: body is now cleared on errors

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574642 -10800 # Sat Apr 20 03:57:22 2024 +0300 # Node ID 6ce5ad05c4f81b9a9dd626c16a3f1e424ef9010f # Parent 20eed25e08bb2b46bd5deddba63f5b4d4779e4a4 Request body: body is now cleared on errors. Previously, after errors the request body was

[PATCH 11 of 14] Request body: handling of body after unbuffered reading

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574643 -10800 # Sat Apr 20 03:57:23 2024 +0300 # Node ID 718f5b5737277ed252d7bddd2f60c47c2a05f42a # Parent 6ce5ad05c4f81b9a9dd626c16a3f1e424ef9010f Request body: handling of body after unbuffered reading. As long as unbuffered reading of t

[PATCH 12 of 14] Request body: error_page 413 handling with HTTP/2 and HTTP/3

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574645 -10800 # Sat Apr 20 03:57:25 2024 +0300 # Node ID b842b7f11593169f0b44cc1b6aa74e631c17c292 # Parent 718f5b5737277ed252d7bddd2f60c47c2a05f42a Request body: error_page 413 handling with HTTP/2 and HTTP/3. When the client_max_body_size

[PATCH 14 of 14] Request body: discarded body now treated as no body

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574649 -10800 # Sat Apr 20 03:57:29 2024 +0300 # Node ID 7462f09d224220ae96ad181c823c2760cec8ba54 # Parent 4a81de7ba1d061f90960a5cc44d3a08e8c45fc1e Request body: discarded body now treated as no body. Notably, proxying of such requests now

[PATCH 13 of 14] Modified $content_length to match available request body length

2024-04-19 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1713574647 -10800 # Sat Apr 20 03:57:27 2024 +0300 # Node ID 4a81de7ba1d061f90960a5cc44d3a08e8c45fc1e # Parent b842b7f11593169f0b44cc1b6aa74e631c17c292 Modified $content_length to match available request body length. As long as the request bod

Re: [PATCH 00 of 14] request body discarding cleanup

2024-04-19 Thread Maxim Dounin
Hello! On Sat, Apr 20, 2024 at 03:59:48AM +0300, Maxim Dounin wrote: > The following patch series is focused on various edge cases related > to reading and discarding of a request body. > > Notably, it should be now safe (from the request body point of view) > to configure complex processing for