diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-06-05 21:18:55 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-06-05 21:18:55 +0300 |
commit | 6123b2ab2b9c658612df3279567dc709d8eb3220 (patch) | |
tree | c2166a97eb8b62f953dd13738eaac472b9e7352c | |
parent | 732bc0a0c3971ede380a6237635f383745515aa0 (diff) | |
download | libmicrohttpd-6123b2ab2b9c658612df3279567dc709d8eb3220.tar.gz libmicrohttpd-6123b2ab2b9c658612df3279567dc709d8eb3220.zip |
Fixed header size calculation.
Previous calculation was incorrect, header size was always
negative (overflow) number.
New calculation takes into account full header size, including
the last empty line with linefeeds.
-rw-r--r-- | src/microhttpd/connection.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index b240e14a..3102b24f 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -3550,7 +3550,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
3550 | if (0 == line[0]) | 3550 | if (0 == line[0]) |
3551 | { | 3551 | { |
3552 | connection->state = MHD_CONNECTION_HEADERS_RECEIVED; | 3552 | connection->state = MHD_CONNECTION_HEADERS_RECEIVED; |
3553 | connection->header_size = (size_t) (line - connection->read_buffer); | 3553 | connection->header_size = (size_t) (connection->read_buffer |
3554 | - connection->method); | ||
3554 | continue; | 3555 | continue; |
3555 | } | 3556 | } |
3556 | if (MHD_NO == process_header_line (connection, | 3557 | if (MHD_NO == process_header_line (connection, |
@@ -3586,7 +3587,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
3586 | if (0 == line[0]) | 3587 | if (0 == line[0]) |
3587 | { | 3588 | { |
3588 | connection->state = MHD_CONNECTION_HEADERS_RECEIVED; | 3589 | connection->state = MHD_CONNECTION_HEADERS_RECEIVED; |
3589 | connection->header_size = (size_t) (line - connection->read_buffer); | 3590 | connection->header_size = (size_t) (connection->read_buffer |
3591 | - connection->method); | ||
3590 | continue; | 3592 | continue; |
3591 | } | 3593 | } |
3592 | continue; | 3594 | continue; |