Commit Graph
3748 Commits
Author SHA1 Message Date
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
Evgeny Grin (Karlson2k) 9949f0f3ac Used faster internal function for Date: timestamp 2021-08-01 20:56:51 +03:00
Evgeny Grin (Karlson2k) 8933bf8fe1 Added internal MHD_uint8_to_str_pad() function
Function prints decimal numbers padded with zero
2021-08-01 18:27:01 +03:00
Evgeny Grin (Karlson2k) 571bdda907 response headers: disallow space in header name, allow tab in header value 2021-08-01 15:33:31 +03:00
Evgeny Grin (Karlson2k) 39eb60df61 response header: more pre-processing, better docs
* Disallow "Transfer-encoding: identity", not allowed by RFC
* Allow only single "Date" header
2021-08-01 15:31:30 +03:00
Evgeny Grin (Karlson2k) db2ab3a5ae response: do not allow "Connection: keep-alive" header 2021-08-01 13:24:32 +03:00
Evgeny Grin (Karlson2k) 497a3546bc Added MHD_uint64_to_str() internal function 2021-07-30 18:41:46 +03:00
Evgeny Grin (Karlson2k) aadbe63575 connection cleanup: streamlined cleanup process 2021-07-30 11:54:25 +03:00
Evgeny Grin (Karlson2k) 8df85c22f8 Updated some copyrights 2021-07-30 10:58:07 +03:00
Evgeny Grin (Karlson2k) 3e1c67a792 test_get_chunked: added tests with know size 2021-07-30 10:47:12 +03:00
Evgeny Grin (Karlson2k) 1130d9c0d0 MemoryPool: fixed assert 2021-07-29 21:40:33 +03:00
Evgeny Grin (Karlson2k) f7db31373e Moved reset of connection to dedicated function 2021-07-29 21:35:00 +03:00
Evgeny Grin (Karlson2k) c106ce2a4f MHD_connection_close_ (): changed clean-up order
* Mark connection as "ready for closure" only after clean-up
* Destroy response only after notifying of the client
2021-07-29 21:04:51 +03:00
Evgeny Grin (Karlson2k) 0d6210fbfd build_connection_chunked_response_footer: asserts added 2021-07-28 15:08:34 +03:00
Evgeny Grin (Karlson2k) 922bf0e5c4 Added more tests for chunked reply encoding 2021-07-28 14:59:09 +03:00