diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-21 17:32:34 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-21 17:37:15 +0300 |
commit | b05555f8372fd848698d87133d8ed194820ede1e (patch) | |
tree | aa8bfc0b18ee4747d3810f4452e65ba3bbd76c5a /src/include/microhttpd.h | |
parent | 38e2c1faacaf061c5a56de537e64eb86bdb4928f (diff) | |
download | libmicrohttpd-b05555f8372fd848698d87133d8ed194820ede1e.tar.gz libmicrohttpd-b05555f8372fd848698d87133d8ed194820ede1e.zip |
Added new daemon flag MHD_USE_NO_THREAD_SAFETY
Do not assume anymore single-threaded environment if external polling
is used.
The application is free to use multiple threads if MHD in the external
polling mode.
The new flag could be used to disable some thread-safety in MHD to
improve single-thread processing speed and resources usage. Basically
the new flag restores the old behaviour for external polling mode.
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r-- | src/include/microhttpd.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index e1d12645..13bd2cbf 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -96,7 +96,7 @@ extern "C" | |||
96 | * they are parsed as decimal numbers. | 96 | * they are parsed as decimal numbers. |
97 | * Example: 0x01093001 = 1.9.30-1. | 97 | * Example: 0x01093001 = 1.9.30-1. |
98 | */ | 98 | */ |
99 | #define MHD_VERSION 0x00097706 | 99 | #define MHD_VERSION 0x00097707 |
100 | 100 | ||
101 | /* If generic headers don't work on your platform, include headers | 101 | /* If generic headers don't work on your platform, include headers |
102 | which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', | 102 | which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', |
@@ -1531,7 +1531,19 @@ enum MHD_FLAG | |||
1531 | * Flag set to enable TLS 1.3 early data. This has | 1531 | * Flag set to enable TLS 1.3 early data. This has |
1532 | * security implications, be VERY careful when using this. | 1532 | * security implications, be VERY careful when using this. |
1533 | */ | 1533 | */ |
1534 | MHD_USE_INSECURE_TLS_EARLY_DATA = 1U << 18 | 1534 | MHD_USE_INSECURE_TLS_EARLY_DATA = 1U << 18, |
1535 | |||
1536 | /** | ||
1537 | * Indicates that MHD daemon will be used by application in single-threaded | ||
1538 | * mode only. When this flag is set then application must call any MHD | ||
1539 | * function only within a single thread. | ||
1540 | * This flag turns off some internal thread-safety and allows MHD making | ||
1541 | * some of the internal optimisations suitable only for single-threaded | ||
1542 | * environment. | ||
1543 | * Not compatible with #MHD_USE_INTERNAL_POLLING_THREAD. | ||
1544 | * @note Available since #MHD_VERSION 0x00097707 | ||
1545 | */ | ||
1546 | MHD_USE_NO_THREAD_SAFETY = 1U << 19 | ||
1535 | 1547 | ||
1536 | }; | 1548 | }; |
1537 | 1549 | ||