1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
Werner Koch a5e33618f4
dirmngr: Fix handling of the HTTP Content-Length
* dirmngr/http.c (cookie_s): Add fields pending, up_to_empty_line,
last_was_lf, and last_was_lfcr.
(http_context_s): Add field keep-alive.
(http_wait_response): Set up_to_empty_line.  Take care of keep_alive
flag.
(coookie_read): Implement detection of empty lines.
(cookie_write): Free the pending buffer.
--

The problem we fix here is that we already buffered stuff beyond the
empty line which marks the start of the content-length counting.  Thus
we tried to wait for more bytes despite that everything had already
been read.  This bug might have showed up more often in the real world
since the we changed the BUFSIZ on Windows from 512 byte to 8k.  It
also depends on the length of the headers and whether the server
closed the connection so that we ignored the Content-Length.

The bug was introduced earlier than 2010 and could have the effect
that a connection got stuck until the network layer timed out.

Note that the keep-alive parts of the patch are not yet used.
2023-09-26 14:19:26 +02:00
..
2018-10-25 16:53:05 -04:00
2023-06-20 09:08:14 +09:00
2023-03-20 19:24:49 +01:00
2021-01-19 10:33:03 +01:00
2017-03-03 17:17:26 +01:00
2023-09-26 13:58:31 +02:00
2017-03-07 20:25:54 +09:00
2023-08-24 11:25:30 +02:00
2017-03-07 20:25:54 +09:00
2021-12-17 13:33:40 +09:00
2010-06-09 16:53:51 +00:00
2018-11-05 09:00:02 +01:00
2011-02-04 12:57:53 +01:00
2022-02-27 12:26:38 +01:00