Commit Graph
3762 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) d8ea84fd6d connection.c: minor updates: used new reply flags, added asserts and TODOs 2021-08-21 14:28:05 +03:00
Evgeny Grin (Karlson2k) 08d144ba19 Do not use the same flag for chunked request and chunked reply 2021-08-21 13:18:29 +03:00
Evgeny Grin (Karlson2k) 5d35f4f7f9 replies: fixed HTTP/1.0 keep-alive replies
Always send "Connection:" headers when replying with keep-alive HTTP/1.0
2021-08-20 15:42:34 +03:00
Evgeny Grin (Karlson2k) 4169e7b6cc test_get_close_keep_alive: added more combinations and more checks
The test now checks all combination of parameters.
Added check for absence of "Keep-Alive" header when it's needed.
Added checks for HTTP version of MHD replies.
Added checks whether socket was / wasn't closed by libcurl.
2021-08-20 13:39:05 +03:00
Evgeny Grin (Karlson2k) a0edd36628 Simple fix for 6f48db46b1 2021-08-19 21:18:51 +03:00
Evgeny Grin (Karlson2k) 6f48db46b1 Added response flag to always send "Connection:" header 2021-08-19 20:11:13 +03:00
Evgeny Grin (Karlson2k) dab2db20fd microhttpd.h: moved up MHD_VERSION macro 2021-08-19 16:48:25 +03:00
Evgeny Grin (Karlson2k) a96eaaaa25 Response flags: clarified functionality, added synonymous names
Fixed support for explicitly requested Keep-Alive with
responses with MHD_RF_HTTP_VERSION_1_0_RESPONSE flag
2021-08-19 16:40:11 +03:00
Evgeny Grin (Karlson2k) f5fc702a4d RFC compliance: HTTP/1.1 replies for HTTP/1.0 clients 2021-08-19 14:32:15 +03:00
Evgeny Grin (Karlson2k) 5c7a9ff9c3 setup_reply_properties(): removed one assert
Actually non-chunked can be enforced by response flags
2021-08-18 20:19:26 +03:00
Evgeny Grin (Karlson2k) be1065889b keepalive_possible: simplified; added new value for MHD_ConnKeepAlive 2021-08-18 19:21:42 +03:00
Evgeny Grin (Karlson2k) ea1edc3dc6 test_get_chunked: re-use the same port for all tests 2021-08-18 14:05:22 +03:00
Evgeny Grin (Karlson2k) b70fa61d47 test_get_chunked: check whether chunked is used for non-Keep-Alive 2021-08-18 12:52:32 +03:00
Evgeny Grin (Karlson2k) 496900010b RFC compliance: use chunked even for non-Keep-Alive HTTP/1.1 clients 2021-08-18 12:52:31 +03:00
Evgeny Grin (Karlson2k) be6faace00 microhttpd.h: minor macro formatting 2021-08-18 12:50:23 +03:00
Evgeny Grin (Karlson2k) 0c3806b058 curl tests: updated select() error handling, file doxy
Tests reports now about unexpected errors from select() and
source code line number to simplify problematic position
locating.
Used much smaller timeout on W32 if system is doing some
sockets data processing in other threads.
2021-08-18 12:48:46 +03:00
Christian Grothoff ebd43f0373 -bump version 2021-08-18 11:10:42 +02:00
Evgeny Grin (Karlson2k) 3db35a4ca6 test_get_close_keep_alive: removed double assignment of curl header 2021-08-18 10:18:37 +03:00
Evgeny Grin (Karlson2k) 83c0cc0720 Updated .gitignore 2021-08-18 10:14:12 +03:00
Evgeny Grin (Karlson2k) 02af598a81 test_get_close_keep_alive: minor reporting improvment 2021-08-18 10:13:36 +03:00
Evgeny Grin (Karlson2k) 16ac89f3be Fixed: avoid duplication of "close" token in replies 2021-08-17 21:34:41 +03:00
Evgeny Grin (Karlson2k) cc29f300ab Fixed: do not enforce "close" connection if reply has no body and
size is unknown
2021-08-17 21:33:58 +03:00
Evgeny Grin (Karlson2k) 3fa1d302d2 Fixed: always close connection if "close" was requested by client 2021-08-17 21:32:29 +03:00
Evgeny Grin (Karlson2k) f30afba986 Simplified makefile for testcurl 2021-08-17 21:30:53 +03:00
Evgeny Grin (Karlson2k) 21b807ae1c Added two tests for correct choice of "Keep-Alive" or "Close" 2021-08-17 20:57:08 +03:00
Evgeny Grin (Karlson2k) b812b174c3 tests: improved handling of curl multi_* 2021-08-16 19:30:25 +03:00
Evgeny Grin (Karlson2k) 303d42fdcd test_get_chunked: fixed leak of libcurl resource for "close" mode 2021-08-16 14:50:22 +03:00
Evgeny Grin (Karlson2k) 99455892ab HTTPS tests: fixed memory leak in tests 2021-08-16 11:55:23 +03:00
Evgeny Grin (Karlson2k) dd21230987 test_get_chunked: do not allocate buffer for cls when not needed 2021-08-16 11:25:27 +03:00
Evgeny Grin (Karlson2k) 6e7e5e26e4 test_get_chunked: fixed validation error report 2021-08-16 11:18:21 +03:00
Evgeny Grin (Karlson2k) d2e271a4eb connection.c: added assert to mute static analyzer 2021-08-16 11:09:48 +03:00
Evgeny Grin (Karlson2k) 1dafa07eb3 connection.c: added check to mute static analyzer error 2021-08-16 10:33:31 +03:00
Evgeny Grin (Karlson2k) ada8dc689e Fixed memory leak introduced by 39eb60df61
When "Date:" header is replaced with new value, old value wasn't freed
2021-08-16 10:21:48 +03:00
Evgeny Grin (Karlson2k) 4820d93bc9 Complete re-write of reply header build function and helpers
The reply headers build function was re-implemented from scratch.
Added some helper functions to simplify maintainability and increase readability.
Fixed chunked encoding handling and compliance with RFC.
This implementation tries to resemble behavior of previous implementations
(except fixes).
Some code is marked with TODO to make further improvements.
2021-08-15 20:12:10 +03:00
Evgeny Grin (Karlson2k) 225268ae81 chunked response: do not try to send more than needed 2021-08-15 18:23:52 +03:00
Evgeny Grin (Karlson2k) 5383019bf5 connection.c: fixed chunked response without callback 2021-08-15 18:23:52 +03:00
Evgeny Grin (Karlson2k) 4595a443ed Added more chunked response tests 2021-08-15 18:23:33 +03:00
Evgeny Grin (Karlson2k) 564c953306 Fixed chunked response with known size
When size was known for chunked response, "response end of the
response" marker was not sent
2021-08-15 18:22:34 +03:00
Evgeny Grin (Karlson2k) 466a56e3af test_get_chunked: set footer when last chunk is being sending 2021-08-15 15:52:03 +03:00
Evgeny Grin (Karlson2k) 2143696e9f test_callback: cosmetics 2021-08-15 15:51:12 +03:00
Evgeny Grin (Karlson2k) a03cd38794 test_callback: improved test
Added detection of curl reported errors,
Added check that data was sent.
2021-08-15 15:51:01 +03:00
Alexander Irion f5d387df7e Fix busy waiting up to one second using connection timeout
MHD_daemon_get_timeout computes the time to wait as:
timeout = (last_activity + connection_timeout - MHD_monotonic_sec_counter ()) * 1000

After sleeping timeout milliseconds, MHD_monotonic_sec_counter () will be:

MHD_monotonic_sec_counter () = last_activity + connection_timeout

With that (timeout < (MHD_monotonic_sec_counter () - connection->last_activity)) evaluates to false and the MHD_connection_close_ is not done.
For the next cycle, MHD_daemon_get_timeout() will return 0 and this goes on, until MHD_monotonic_sec_counter jumps to the next second.

This bug causes thousands of unnecessary calls to MHD_run, when a connection timed out.
2021-08-11 22:38:41 +02:00
Evgeny Grin (Karlson2k) e9fbb33158 connection.c: cosmetics 2021-08-11 22:33:20 +03:00
Evgeny Grin (Karlson2k) 96a0da03fe response.c: used stricter check for "Upgrade:" header 2021-08-11 22:26:31 +03:00
Evgeny Grin (Karlson2k) af3fc639b3 response headers: do not allow "Close" with upgrade responses 2021-08-11 22:26:31 +03:00
Evgeny Grin (Karlson2k) 88da9c6f15 internal.h: minor doxy correction 2021-08-11 22:26:31 +03:00
Evgeny Grin (Karlson2k) dd9c707576 MHD_queue_response(): detect incorrect "upgrade" responses 2021-08-11 22:26:31 +03:00
Christian Grothoff d929a44741 -typo 2021-08-04 19:07:27 +02:00
Christian Grothoff f1f8851cd2 introduce new MHD_CONNECTION_INFO_HTTP_STATUS 2021-08-04 18:58:55 +02:00
Evgeny Grin (Karlson2k) 88b880e928 Minor doxy correction for 9949f0f3ac 2021-08-02 16:15:21 +03:00