Commit Graph
4961 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) 127a964c7b connection.c: corrected error responses 2023-06-20 23:22:55 +03:00
Evgeny Grin (Karlson2k) edde133d39 Added tests with single and double folded header 2023-06-20 23:22:55 +03:00
Evgeny Grin (Karlson2k) 48ae1a36da Added test with large folded header 2023-06-20 23:22:55 +03:00
Evgeny Grin (Karlson2k) 04ad057ab9 Added test with folded header placed last 2023-06-20 23:22:55 +03:00
Evgeny Grin (Karlson2k) 6878cd9144 Added new tests with header fold 2023-06-20 23:22:54 +03:00
Evgeny Grin (Karlson2k) c0f7cbb280 Added back testing with socat as a fallback option 2023-06-20 23:22:54 +03:00
Evgeny Grin (Karlson2k) 40b675518b testzzuf: re-worked zzuf testing
* merged test_get, test_get_chunked, test_put
* fixed use of header instead of footer in chunked data callback
* added checks for results of all used MHD functions
* added reading of all data in the input buffer provided by MHD for
  callback
* re-used libcurl handles to re-use connections in all modes
* added testing of 'poll' and 'epoll' for all tests
* removed the need for socat
* removed forking with potential forked process zombies
* fixed processing only of the first request (as soon  as socat
  connection become broken, all following requests went to nowhere)
* implemented correct response for unsupported methods
* used proper timeout for 'external select()' (taken into account
  libcurl timeout too)
* added check for extra reply data
* added debug print of libcurl sent and received data
* merged all tests into single source file
* fixed a lot of compiler warnings
* added check for incorrect replies produced by MHD
2023-06-20 23:22:54 +03:00
Evgeny Grin (Karlson2k) 87d40361d3 testzzuf: added special debug functions 2023-06-20 23:22:54 +03:00
Evgeny Grin (Karlson2k) 4b8fb0700b daemon: added debug member to avoid accept4() usage 2023-06-20 23:22:53 +03:00
Evgeny Grin (Karlson2k) dce208464a tests: minor improvemnts 2023-06-20 23:22:53 +03:00
Evgeny Grin (Karlson2k) 4e8e5e653d Removed request line and headers processing old functions and variables 2023-06-20 23:22:53 +03:00
Evgeny Grin (Karlson2k) eaf1fa0889 Re-implemented parsing of the request headers and footers from scratch.
* The new algorithm parse the headers in one pass (including folded
headers) thus multiple passes over the same memory area are avoided
(efficiency for large headers should be improved).
* Strict implementation of RFC 9110 and 9112 requirements, including
replacing or reporting error for unacceptable characters.
* Implemented various levels of strictness for requests interpretations:
three levels within RFC requirements (more strict and more secure; less
strict and more compatible with various clients; balanced (default)),
one more relaxed level with violation of RFC's SHOULD/SHOULD NOT,
one even more relaxed level with violation of MUST/MUST NOT,
one stricter level then required by RFC, but absolutely compatible with
clients following RFC's MUST/MUST NOT, and one more even stricter level
compatible with clients following both MUST/MUST NOT and
SHOULD/SHOULD NOT.
* Added detection and handling of more erroneous situations, like space
at the start of the first line (as recommended by RFC).
* Added more detailed responses for invalid requests with descriptions
of the found problems (as recommended by RFC).
* If many chars have been replaced, only summary is reported instead
of flooding logs with messages when request is badly constructed.
* Whitespaces in headers values are trimmed at start and at the end. No
need to handle extra spaces in the app or when using headers in other
MHD parts, like cookie parsing.
* In overall: increased flexibility, the security must be improved,
much better compliance with the standards.
2023-06-20 22:59:07 +03:00
Evgeny Grin (Karlson2k) 69da856991 Request body processing: removed impossible code paths
Some code paths are impossible. Removed and replaced with asserts.
Also redundant checks are removed.
2023-06-20 22:59:07 +03:00
Evgeny Grin (Karlson2k) 9141692ad5 Renamed connection state for clarity 2023-06-20 22:59:07 +03:00
Evgeny Grin (Karlson2k) b483c0f6d3 microhttpd.h: fixed typos in comments 2023-06-20 22:59:06 +03:00
Evgeny Grin (Karlson2k) bd605be202 Re-implemented parsing of the request line from scratch.
* New algorithm parse the request line in one pass thus multiple passes
over the same memory area are avoided (efficiency for large URI should
be improved)
* Strict implementation of RFC 9110 and 9112 requirements, unacceptable
characters are replaced or threaded as errors.
* Implemented various levels of strictness for requests interpretations:
three levels within RFC requirements (more strict and more secure; less
strict and more compatible with various clients; balanced (default)),
one more relaxed level with violation of RFC's SHOULD/SHOULD NOT,
one even more relaxed level with violation of MUST/MUST NOT,
one stricter level then required by RFC, but absolutely compatible with
clients following RFC's MUST/MUST NOT, and one more even stricter level
compatible with clients following both MUST/MUST NOT and
SHOULD/SHOULD NOT.
* Added more detailed responses for invalid requests with descriptions
of the found problems (as recommended by RFC).
* Limited number of empty lines skipped before the request (as
recommended by RFC).
* Implemented automatic redirection responses for requests targets
with forbidden characters (as recommended by RFC).
* In overall: increased flexibility, the security must be improved,
much better compliance with the standards.
2023-06-20 22:59:06 +03:00
Evgeny Grin (Karlson2k) eaa3be77c3 Refactoring: check whether memory block is resizable
Instead of using some heuristics to determine which block is resizable,
use new special function to check
2023-06-20 21:06:41 +03:00
Evgeny Grin (Karlson2k) 8dc93b0834 base64 decoding: added more compact code version
Also added more base64 test sequencies
2023-06-09 13:11:12 +03:00
Evgeny Grin (Karlson2k) 4993c15202 Added test for MHD_get_version{,_bin} function and related macros 2023-06-08 16:13:15 +03:00
Evgeny Grin (Karlson2k) c2d5c80c71 Bump version in 'configure' as well 2023-06-07 22:02:13 +03:00
Evgeny Grin (Karlson2k) ddfa808bb4 Bump version numbers as v0.9.77 was released on parallel branch 2023-06-06 22:56:36 +03:00
Evgeny Grin (Karlson2k) d17b6cb79d MHD_base64_to_bin_n(): improved readbility
No functional change
2023-06-05 20:20:30 +03:00
Evgeny Grin (Karlson2k) 3a3208c002 mhd_str: hex to value optimisation 2023-06-05 20:20:24 +03:00
Christian Grothoff dc1973a702 -typos 2023-06-03 12:58:55 +02:00
Evgeny Grin (Karlson2k) 4ddb80153c W32 VS Project: fixed warning with external build systems 2023-06-01 13:28:26 +03:00
Evgeny Grin (Karlson2k) 4d5f24f7df autoinit_funcs.h: fixed warning on MSVC 2023-06-01 13:28:26 +03:00
Evgeny Grin (Karlson2k) 36af2166bc W32 VS Project: minor internal fixes, fixed files for "dist" 2023-06-01 13:28:25 +03:00
Evgeny Grin (Karlson2k) dca5d029c9 W32 VS project: reverted to standard arches names 2023-06-01 13:28:25 +03:00
Evgeny Grin (Karlson2k) fbd7cef55e Added macro for base64 decoded size 2023-06-01 13:27:49 +03:00
Evgeny Grin (Karlson2k) 61b407a25a Avoided potential compiler warnings 2023-06-01 13:03:11 +03:00
Evgeny Grin (Karlson2k) 5da716e8c2 Fixed compiler warning when built without poll() support 2023-06-01 13:00:48 +03:00
Evgeny Grin (Karlson2k) 79c57fad8d daemon.c: redesigned code for clarity and formatting
No functional change
2023-06-01 13:00:15 +03:00
Evgeny Grin (Karlson2k) ba5538e246 contrib/make-dist.sh: added use of zopfli if available 2023-06-01 12:55:22 +03:00
Evgeny Grin (Karlson2k) f5b06de9cd Added support for custom command for tarball compression 2023-06-01 12:55:16 +03:00
Evgeny Grin (Karlson2k) eb5be268d9 test_client_put_stop: fixed typo in diag message 2023-06-01 12:34:35 +03:00
Evgeny Grin (Karlson2k) 97dec411eb Detect sysctl() symbols in configure
Symbols could be enum values, not necessary macros
2023-06-01 11:31:48 +03:00
Evgeny Grin (Karlson2k) dd4f6ff9ea websocket_threaded_example: fixed wrong commented-out code 2023-06-01 11:29:44 +03:00
Evgeny Grin (Karlson2k) 3389c7fbba .gitignore: force include all *.{c,h} files 2023-06-01 11:29:25 +03:00
Evgeny Grin (Karlson2k) 6806dc46a0 test_client_put_stop: muted compiler warnings 2023-06-01 11:28:50 +03:00
Evgeny Grin (Karlson2k) 612d20b28d Added internal preprocessor macro for magic macro presence 2023-06-01 11:28:22 +03:00
Evgeny Grin (Karlson2k) 4fc2b96bb8 tests: unified use of function name macros 2023-06-01 11:21:52 +03:00
Evgeny Grin (Karlson2k) 4973c6cff0 Simplified usage of the function name magic macros 2023-06-01 11:09:16 +03:00
Evgeny Grin (Karlson2k) 4805f6a8ee configure: fixed detection of __FUNCTION__ magic macro 2023-06-01 11:07:58 +03:00
Evgeny Grin (Karlson2k) feb9ac1f4c examples/sessions.c: removed non-portable function and improved safety 2023-06-01 10:58:16 +03:00
Evgeny Grin (Karlson2k) 3002ca583e test_post: fixed caseless key name match 2023-06-01 09:44:31 +03:00
Evgeny Grin (Karlson2k) 3806c7ba24 examples/largepost.c: fixed caseless method match 2023-06-01 09:43:35 +03:00
Evgeny Grin (Karlson2k) c4633c32c1 Added specific headers inclusion and detection
This is a workaround for headers mess on Solaris
2023-06-01 09:43:01 +03:00
Evgeny Grin (Karlson2k) 70c1dbb15b test_timeout: moved to heavy tests 2023-06-01 09:41:22 +03:00
Evgeny Grin (Karlson2k) f9550a2c8d test_client_put_stop: avoid stress-testing the OS 2023-06-01 09:39:36 +03:00
Evgeny Grin (Karlson2k) a9cd61a224 test_client_put_stop: fixed typo in comment 2023-06-01 09:31:43 +03:00