Adjust chunked encoding handling.
authorclaudio <claudio@openbsd.org>
Fri, 9 Sep 2022 08:11:06 +0000 (08:11 +0000)
committerclaudio <claudio@openbsd.org>
Fri, 9 Sep 2022 08:11:06 +0000 (08:11 +0000)
commitfd522c34be5cdd9c45f52649bfcf949d573e438a
tree21bcb626364d0911ec40cabf56cd5f81084974f7
parentf6417410045f64ca962af323ec8fdc3e18493436
Adjust chunked encoding handling.

Add an extra state to distinguish in between chunks CRLF handling from
the last chunk which can optionally have some trailer fields included.
rpki-client ignores these trailer header fields (they are also not common
it seems).
Also remove the empty line handling in http_parse_chunked() for explicit
checks in http_read(). Because of the extra state the switch back to
non-chunked mode can now be delayed until the transfer is over.

OK tb@
usr.sbin/rpki-client/http.c