Commit Graph
4924 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) 280fb849e0 Minor readability improvements 2021-12-01 15:05:56 +03:00
Evgeny Grin (Karlson2k) 3f63454148 mhd_sockets: reordered includes for better compatibility 2021-12-01 15:05:56 +03:00
Evgeny Grin (Karlson2k) 969cbdf6a6 Added missing ifdef guard for <stdbool.h> 2021-12-01 15:05:56 +03:00
Evgeny Grin (Karlson2k) a8423ab884 configure: do header detection before other checks 2021-12-01 15:04:08 +03:00
Evgeny Grin (Karlson2k) e87044f7a3 configure: header detection fixes
Reordered headers detection to allow detect headers which require
inclusion of other headers before them.

Fixed detection of network/socket headers as on some platforms they
require specific headers to be included before.
2021-12-01 15:01:52 +03:00
Evgeny Grin (Karlson2k) 06476807a2 test_client_put_stop: cosmetics 2021-11-29 21:30:34 +03:00
Evgeny Grin (Karlson2k) c6ba7ba254 test_client_put_stop: limit total test time 2021-11-29 14:17:02 +03:00
Evgeny Grin (Karlson2k) 3fddf35bb7 test_client_put_stop: improved readability of the test results 2021-11-29 14:16:05 +03:00
Evgeny Grin (Karlson2k) e910727df7 Partial revert of 8f9567bb48
Use unified timeouts
2021-11-29 13:33:41 +03:00
Evgeny Grin (Karlson2k) 8f9567bb48 test_client_put_stop: Use longer timeout periods for select() 2021-11-28 20:54:46 +03:00
Evgeny Grin (Karlson2k) ff12c57202 test_client_put_stop: suppress SIGPIPE on the client side 2021-11-28 19:44:26 +03:00
Evgeny Grin (Karlson2k) dbf407c26a Fixed MHD_FEATURE_AUTOSUPPRESS_SIGPIPE return value 2021-11-28 19:38:18 +03:00
Evgeny Grin (Karlson2k) 679f259b95 If socket error is detected, try to detect the type of error before closing 2021-11-28 19:20:40 +03:00
Evgeny Grin (Karlson2k) 13cc9afe06 Cosmetics: removed duplicated value 2021-11-28 13:58:18 +03:00
Evgeny Grin (Karlson2k) 5c478c5d61 test_client_put_stop: check for right reason
The termination reason must correspond to type of client socket closure.
2021-11-28 13:21:53 +03:00
Evgeny Grin (Karlson2k) cca1730f8b memorypool: minor doxy clarification 2021-11-25 12:28:52 +03:00
Evgeny Grin (Karlson2k) 5f6ccd331f test_client_put_stop: handle correctly close phase on the client side 2021-11-25 11:44:04 +03:00
Evgeny Grin (Karlson2k) f8c46afbd0 test_client_put_stop: removed unused assignment 2021-11-24 22:29:41 +03:00
Evgeny Grin (Karlson2k) 2e3418c734 test_client_put_stop: fixed asserts 2021-11-24 22:25:32 +03:00
Evgeny Grin (Karlson2k) 8b0105d0d9 test_client_put_stop: removed libcurl leftover 2021-11-24 22:17:53 +03:00
Evgeny Grin (Karlson2k) 385b4df1b9 parse_connection_headers(): report if client payload is too large.
Request payload with sizes larger than 16 EiB (exabytes) are technically
valid, but cannot be processed by MHD. Now they are rejected
with 413 HTTP code.
2021-11-24 21:55:57 +03:00
Evgeny Grin (Karlson2k) 06251c9017 Fixed builds without messages 2021-11-24 21:55:57 +03:00
Evgeny Grin (Karlson2k) e9e6a5f9d6 parse_connection_headers(): simplified 'Content-Length' processing 2021-11-24 21:55:56 +03:00
Evgeny Grin (Karlson2k) a6e53c3676 process_request_body(): rewritten chunk size detection; fixes
* CRCR, LFCR, LFLF, and bare CR are not recognized anymore as single
  line delimiters.
* When only part of chunks size line is available, it is checked for
  validity to abort early on misformed requests.
* Chunks with sizes larger than 16 EiB (exabytes) are technically valid,
  but cannot be processed by MHD. Now they are rejected with 413 code.
2021-11-24 21:55:56 +03:00
Evgeny Grin (Karlson2k) 482ca8e164 process_request_body(): fixed: do allow sizes with more than 16 digits
As per RFC, '000000000000000000000000000000000000001' is a valid size
2021-11-24 19:09:31 +03:00
Evgeny Grin (Karlson2k) 27cd374594 process_request_body(): fixed one byte buffer overrun 2021-11-24 19:09:31 +03:00
Evgeny Grin (Karlson2k) ad9fc5c65a process_request_body(): added assert 2021-11-24 19:09:31 +03:00
Evgeny Grin (Karlson2k) f8ed20822b process_request_body(): fixed: removed wrong special handling of the termination chunk 2021-11-24 19:09:30 +03:00
Evgeny Grin (Karlson2k) f254078644 process_request_body(): minor improvement of code readability 2021-11-24 19:09:30 +03:00
Evgeny Grin (Karlson2k) 6d7825e852 process_request_body(): do not process when no more data is available 2021-11-24 19:09:30 +03:00
Evgeny Grin (Karlson2k) 8a69a44923 process_request_body(): fixed: do not skip chunk closure when too few data available 2021-11-24 19:07:42 +03:00
Evgeny Grin (Karlson2k) eebf9c28f0 process_request_body(): removed one more unneeded check 2021-11-24 19:07:41 +03:00
Evgeny Grin (Karlson2k) 52c6a34137 process_request_body(): removed unneeded check
Non-chunked body must have size.
2021-11-24 19:07:41 +03:00
Evgeny Grin (Karlson2k) 2f18a668c0 process_request_body(): unify checks for chunked upload 2021-11-24 19:07:40 +03:00
Evgeny Grin (Karlson2k) 5b73b66e4e process_request_body(): removed redundant check 2021-11-24 19:07:40 +03:00
Evgeny Grin (Karlson2k) 71cff2d6a3 process_request_body(): replaced 'int' with 'bool' 2021-11-24 19:07:40 +03:00
Evgeny Grin (Karlson2k) 85dbd8dc52 test_client_put_stop: use TCP_NODELAY for client 2021-11-24 19:07:34 +03:00
Evgeny Grin (Karlson2k) 52b7989822 test_client_put_stop: use content longer than 15 bytes
This is required to have two hex digits chunk size.
2021-11-23 15:11:50 +03:00
Evgeny Grin (Karlson2k) 7f68d8de55 Tests: fixed code style 2021-11-23 15:11:50 +03:00
Evgeny Grin (Karlson2k) 742e5bd1b6 Tests: explicitly enforced zero or one exit codes 2021-11-23 15:11:50 +03:00
Evgeny Grin (Karlson2k) 1b435684a7 Clarified termination reasons description
Updated termination reasons reporting.
Make sure that MHD_REQUEST_TERMINATED_READ_ERROR is really reported
Before this patch MHD_REQUEST_TERMINATED_WITH_ERROR was reported instead
2021-11-21 22:06:20 +03:00
Evgeny Grin (Karlson2k) a761eb67b6 Reworking early close flags
'early_response' renamed to 'discard_request'.
Changed the way how flags are checked.
2021-11-21 22:06:19 +03:00
Evgeny Grin (Karlson2k) 025d2ab1b3 test_client_put_*: new tests
Implemented simple emulation of HTTP client to test various MHD
aspects and thorough checking of all MHD callbacks.
2021-11-21 22:06:19 +03:00
Evgeny Grin (Karlson2k) 2a412f8887 tests and examples: fixed copy-paste errors in doxy 2021-11-21 15:43:19 +03:00
Evgeny Grin (Karlson2k) eac16d15db Tests: code style fixes 2021-11-21 15:43:19 +03:00
Evgeny Grin (Karlson2k) 87ab1ec7f7 test and examples: check socket control functions results 2021-11-21 15:43:19 +03:00
Evgeny Grin (Karlson2k) 3b950aef4d tests: fixed blocking sockets on W32
Sockets on W32 were non-blocking due to copy-paste errors.
2021-11-21 15:43:18 +03:00
Evgeny Grin (Karlson2k) 0b9d6e9446 Examples: fixed blocking sockets on W32
Sockets on W32 were non-blocking due to copy-paste errors.
2021-11-21 15:43:13 +03:00
Evgeny Grin (Karlson2k) 5cf4c61bb0 microhttpd.h: doxy comments fixes 2021-11-10 12:40:22 +03:00
Evgeny Grin (Karlson2k) 475cfd18d1 Updated doxy for MHD_AccessHandlerCallback 2021-11-09 20:57:02 +03:00