Commit Graph
4924 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) 86f53a3dda daemon: muted compiler warning 2022-05-05 15:06:59 +03:00
Evgeny Grin (Karlson2k) a7aa1266e1 test_parse_cookies: added more checks 2022-05-05 14:55:45 +03:00
Evgeny Grin (Karlson2k) cc88b5a09d connection.c: fixed doxy 2022-05-04 19:25:32 +03:00
Evgeny Grin (Karlson2k) f50153e5cf configure: added 'debugger' build type
Suitable for walking the code with debugger.
2022-05-04 19:06:40 +03:00
Evgeny Grin (Karlson2k) 26a99d1882 configure: fixed copy-paste error introduced by 5e45bedae5 2022-05-04 18:39:05 +03:00
Evgeny Grin (Karlson2k) 968bb8f87c Updated .gitignore 2022-05-04 18:34:30 +03:00
Evgeny Grin (Karlson2k) 5e45bedae5 configure: use CPPFLAGS for _DEBUG macro
MHD_config.h is not used by some source files. CPPFLAGS force usage of
required assert() mode.
2022-05-04 18:32:33 +03:00
Evgeny Grin (Karlson2k) d32975f45b configure: added missing settings for debug builds 2022-05-04 17:10:11 +03:00
Evgeny Grin (Karlson2k) d031ea8c32 digestauth: re-used static function 2022-05-04 15:58:47 +03:00
Evgeny Grin (Karlson2k) f2aa7b8853 digestauth: added management of nonce-nc map array slots 2022-05-04 15:58:47 +03:00
Evgeny Grin (Karlson2k) 46554d2c55 digestauth: additional static function for code re-use 2022-05-04 15:47:37 +03:00
Evgeny Grin (Karlson2k) 6b722d2bff digestauth: additional macros for readability 2022-05-04 15:47:37 +03:00
Evgeny Grin (Karlson2k) 6224ac6264 digestauth: use mseconds for timestamp
The clash of nonces is lower with higher timestamp resolution
2022-05-04 15:47:37 +03:00
Evgeny Grin (Karlson2k) 5658583a88 digestauth: increased timestamp to 48 bits 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) 6245c9a0a2 digestauth: added run-time checks for algo value 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) f7d878ed66 digestauth: additional assert 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) 65300939cf digestauth: changed type of var 2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) c38e0a30f8 digestauth: use 7 bit shift for fast "hash"
As only ASCII printable chars are used for "nonce", the highest bit
is always zero.
2022-05-04 15:47:36 +03:00
Evgeny Grin (Karlson2k) 338dba5d1d .gitignore: Updated 2022-05-04 15:47:35 +03:00
Evgeny Grin (Karlson2k) fe9ce5db47 internal.h: fixed doxy 2022-05-04 14:24:27 +03:00
Evgeny Grin (Karlson2k) 76b68f654f check_nonce_nc(): sorted checks according to probability
The code should be more readable and it should give very minor
performance improvement.
2022-05-01 17:07:43 +03:00
Evgeny Grin (Karlson2k) c0bb909f0a check_nonce_nc(): additionally improved readability, fixed comments 2022-05-01 16:57:58 +03:00
Evgeny Grin (Karlson2k) f473462465 check_nonce_nc(): fixed missing set of the bit for the old 'nc' value
When 'nc' values are increased sequentially, the bit for the old 'nc'
value was not set.
2022-05-01 16:44:53 +03:00
Evgeny Grin (Karlson2k) 8457dfc7b6 check_nonce_nc(): moved 'nc' overflow check out of mutex lock 2022-05-01 16:32:07 +03:00
Evgeny Grin (Karlson2k) a3527f080a check_nonce_nc(): improved readability, fixed comments 2022-05-01 16:08:17 +03:00
Evgeny Grin (Karlson2k) 628a28d607 check_nonce_nc(): simplified
If 'nc' is not valid, then 'nonce' is always stale as 'nonce' validity
has been checked already.
2022-05-01 16:08:17 +03:00
Evgeny Grin (Karlson2k) 303cc226ec struct MHD_NonceNc: improved doxy 2022-05-01 15:14:06 +03:00
Evgeny Grin (Karlson2k) d6db60e373 digestauth: when checking 'nc' reuse always check nonce match first
While the validity of nonce itself was already checked, it could be stale
nonce, so let's make sure that re-use of 'nc' is limited to the same
nonce only.
2022-05-01 15:04:45 +03:00
Evgeny Grin (Karlson2k) f84c4d60a4 microhttpd.h: fixed list of required types 2022-05-01 14:30:10 +03:00
Evgeny Grin (Karlson2k) 06336118eb digestauth: do not add nonce from client, if it was not generated by MHD 2022-04-30 20:29:57 +03:00
Evgeny Grin (Karlson2k) fbf3b53411 digestauth: added dedicated function for adding the new nonces 2022-04-30 20:21:25 +03:00
Evgeny Grin (Karlson2k) bf9ca17361 check_nonce_nc(): use already known nonce size, avoid size recalculation 2022-04-30 19:39:33 +03:00
Evgeny Grin (Karlson2k) 0effaaad3e digestauth: moved "hash" calculation to separate function 2022-04-28 19:06:46 +03:00
Evgeny Grin (Karlson2k) ba77b04c65 Replaced calls of MHD_get_timeout() in tests and examples
The calls were replaced with the calls of the new functions.
Completely removed the usage of MHD_UNSIGNED_LONG_LONG.
2022-04-28 19:06:46 +03:00
Evgeny Grin (Karlson2k) c6eae238be Added new function MHD_get_timeout_i()
This function is useful for direct in in poll() or epoll_wait().
2022-04-28 19:06:46 +03:00
Evgeny Grin (Karlson2k) aea4dcaefe test_response_entries: improved error print 2022-04-28 19:06:46 +03:00
Evgeny Grin (Karlson2k) d147ab196d response: fixed copy-paste error introduced by b8e13a57a0 2022-04-28 19:06:45 +03:00
Evgeny Grin (Karlson2k) d14fc3b3d7 MHD_get_timeout*(): improved doxy 2022-04-27 22:24:23 +03:00
Evgeny Grin (Karlson2k) dc9a8c4180 Fixes related to implicit cast warnings 2022-04-27 22:11:57 +03:00
Evgeny Grin (Karlson2k) 28a67e3db4 mhd_send: added safe default value if sysconf() is broken 2022-04-27 22:11:56 +03:00
Evgeny Grin (Karlson2k) 18581f1694 Use new function MHD_get_timeout64() in MHD code 2022-04-27 22:11:55 +03:00
Evgeny Grin (Karlson2k) 3c83fa13f0 daemon: added workaround for 'uncrustify' broken formatting 2022-04-27 22:11:55 +03:00
Evgeny Grin (Karlson2k) 860aa4e0ed Added new function MHD_get_timeout64s() 2022-04-27 22:11:55 +03:00
Evgeny Grin (Karlson2k) d77c8b429a get_timeout_millisec_(): refactoring for readability 2022-04-27 22:11:55 +03:00
Evgeny Grin (Karlson2k) 7ad7452c19 Added new function MHD_get_timeout64()
The same functionally as MHD_get_timeout(), but with standard type uint64_t
2022-04-27 22:11:55 +03:00
Evgeny Grin (Karlson2k) 4ebe2aa5f9 thread-per-connection: improved timeout handling for 'poll()' mode, fixed short busy-waiting
* Avoid unneeded wake-ups
* More precise timeout with milliseconds accuracy
* Fixed potential short (less than one second) busy waiting when
  connection is about to expire.
2022-04-27 22:11:54 +03:00
Evgeny Grin (Karlson2k) f3d7ef1f5f thread-per-connection: do not cache connection timeout
The timeout value could be updated by application
2022-04-27 22:11:54 +03:00
Evgeny Grin (Karlson2k) 0424af2a04 Response from callback: do allow negative return amounts, except predefined values 2022-04-27 22:11:54 +03:00
Evgeny Grin (Karlson2k) b8e13a57a0 Fixed compiler warnings of implicit casting, which could change the value 2022-04-27 22:11:53 +03:00
Evgeny Grin (Karlson2k) 8f444c321f MHD_itc_clear_(): simplified eventfd version 2022-04-27 13:51:33 +03:00