public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH http-server 0/2] refactor HTTP request processing
@ 2023-02-17 15:25 Max Carrara
  2023-02-17 15:25 ` [pve-devel] [PATCH http-server 1/2] http-server: anyevent: add new subroutine for processing requests Max Carrara
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Max Carrara @ 2023-02-17 15:25 UTC (permalink / raw)
  To: pve-devel

This patch series refactors the request processing algorithm by
separating its data and logic from one another in order to make future
changes regarding requests more transparent and explicit.

Patch 1: Introduce the refactored algorithm
Patch 2: Replace and remove the existing algorithm with the new one

This refactor is conducted very carefully to ensure that none of the
existing behaviours change in any way. One exception however would be
the reading of the HTTP header itself: Instead of reading the
header by recursively appending / prepending callbacks to the handle's
and reading the header line-by-line, the entire header is read at
once, reducing the number of callbacks needed to parse the header from
the number of lines to one. This affects when the header line count
and size limits are checked - instead of being checked *while* the
header is being read, these limits are verified *after* the header
was read from the read buffer. If this change in behaviour is
undesirable, I'll gladly provide a v2.

Otherwise, the behaviour is identical; the logic is restructured,
but entirely preserved.


To give a more concrete example of what these changes would make more
transparent, the enhancement requested in #4494[1] would become just
another step (-> subroutine) in the refactored algorithm. That way it
becomes much clearer where the TLS handshake is being verified
and which responses (e.g. a `301`) are sent in case the handshake
never happened or was aborted.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=4494


pve-http-server:

Max Carrara (2):
  http-server: anyevent: add new subroutine for processing requests
  http-server: anyevent: replace request processing subroutine

 src/PVE/APIServer/AnyEvent.pm | 671 ++++++++++++++++++++++------------
 1 file changed, 445 insertions(+), 226 deletions(-)

-- 
2.30.2





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-28 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 15:25 [pve-devel] [PATCH http-server 0/2] refactor HTTP request processing Max Carrara
2023-02-17 15:25 ` [pve-devel] [PATCH http-server 1/2] http-server: anyevent: add new subroutine for processing requests Max Carrara
2023-02-28 14:05   ` Fabian Grünbichler
2023-02-17 15:25 ` [pve-devel] [PATCH http-server 2/2] http-server: anyevent: replace request processing subroutine Max Carrara
2023-02-17 17:15 ` [pve-devel] [PATCH http-server 0/2] refactor HTTP request processing Thomas Lamprecht
2023-02-20  9:40   ` Max Carrara
2023-02-20  9:59     ` [pve-devel] [PATCH] http-server: redirect HTTP to HTTPS Max Carrara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal