diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-11-08 00:37:29 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-11-08 01:00:00 +0300 |
commit | c39f9bfb2696e0b7c04c6f4b90ea0ab8b646e064 (patch) | |
tree | 4868e6b3bd73c991dc92a16c50b82f28a3a7d978 /src/include | |
parent | fdf24fa69fb92db404db45f37563729947c9e380 (diff) | |
download | libmicrohttpd-c39f9bfb2696e0b7c04c6f4b90ea0ab8b646e064.tar.gz libmicrohttpd-c39f9bfb2696e0b7c04c6f4b90ea0ab8b646e064.zip |
Specify that flag MHD_USE_INTERNAL_POLLING_THREAD is mandatory if MHD_USE_THREAD_PER_CONNECTION is used
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/microhttpd.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 7b37d0f7..4a8c8142 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -516,9 +516,10 @@ struct MHD_PostProcessor; | |||
516 | /** | 516 | /** |
517 | * @brief Flags for the `struct MHD_Daemon`. | 517 | * @brief Flags for the `struct MHD_Daemon`. |
518 | * | 518 | * |
519 | * Note that if neither #MHD_USE_THREAD_PER_CONNECTION nor | 519 | * Note that MHD will run automatically in background thread(s) only |
520 | * #MHD_USE_INTERNAL_POLLING_THREAD is used, the client wants control over | 520 | * if #MHD_USE_INTERNAL_POLLING_THREAD is used. Otherwise caller (application) |
521 | * the process and will call the appropriate microhttpd callbacks. | 521 | * must use #MHD_run() or #MHD_run_from_select() to have MHD processed |
522 | * network connections and data. | ||
522 | * | 523 | * |
523 | * Starting the daemon may also fail if a particular option is not | 524 | * Starting the daemon may also fail if a particular option is not |
524 | * implemented or not supported on the target platform (i.e. no | 525 | * implemented or not supported on the target platform (i.e. no |
@@ -553,12 +554,18 @@ enum MHD_FLAG | |||
553 | 554 | ||
554 | /** | 555 | /** |
555 | * Run using one thread per connection. | 556 | * Run using one thread per connection. |
557 | * Must be used only with #MHD_USE_INTERNAL_POLLING_THREAD. | ||
556 | */ | 558 | */ |
557 | MHD_USE_THREAD_PER_CONNECTION = 4, | 559 | MHD_USE_THREAD_PER_CONNECTION = 4, |
558 | 560 | ||
559 | /** | 561 | /** |
560 | * Run using an internal thread (or thread pool) for sockets sending | 562 | * Run using an internal thread (or thread pool) for sockets sending |
561 | * and receiving and data processing. | 563 | * and receiving and data processing. Without this flag MHD will not |
564 | * run automatically in background thread(s). | ||
565 | * If this flag is set, #MHD_run() and #MHD_run_from_select() couldn't | ||
566 | * be used. | ||
567 | * This flag is set explicitly by #MHD_USE_POLL_INTERNAL_THREAD and | ||
568 | * by #MHD_USE_EPOLL_INTERNAL_THREAD. | ||
562 | */ | 569 | */ |
563 | MHD_USE_INTERNAL_POLLING_THREAD = 8, | 570 | MHD_USE_INTERNAL_POLLING_THREAD = 8, |
564 | 571 | ||
@@ -666,9 +673,8 @@ enum MHD_FLAG | |||
666 | 673 | ||
667 | /** | 674 | /** |
668 | * Use inter-thread communication channel. | 675 | * Use inter-thread communication channel. |
669 | * #MHD_USE_ITC can be used with internal select/poll/other | 676 | * #MHD_USE_ITC can be used with #MHD_USE_INTERNAL_POLLING_THREAD |
670 | * or #MHD_USE_THREAD_PER_CONNECTION and is ignored with any | 677 | * and is ignored with any "external" mode. |
671 | * "external" mode. | ||
672 | * It's required for use of #MHD_quiesce_daemon | 678 | * It's required for use of #MHD_quiesce_daemon |
673 | * or #MHD_add_connection. | 679 | * or #MHD_add_connection. |
674 | * This option is enforced by #MHD_ALLOW_SUSPEND_RESUME or | 680 | * This option is enforced by #MHD_ALLOW_SUSPEND_RESUME or |
@@ -1832,10 +1838,10 @@ MHD_get_timeout (struct MHD_Daemon *daemon, | |||
1832 | * This function is a convenience method, which is useful if the | 1838 | * This function is a convenience method, which is useful if the |
1833 | * fd_sets from #MHD_get_fdset were not directly passed to `select()`; | 1839 | * fd_sets from #MHD_get_fdset were not directly passed to `select()`; |
1834 | * with this function, MHD will internally do the appropriate `select()` | 1840 | * with this function, MHD will internally do the appropriate `select()` |
1835 | * call itself again. While it is always safe to call #MHD_run (in | 1841 | * call itself again. While it is always safe to call #MHD_run (if |
1836 | * external select mode), you should call #MHD_run_from_select if | 1842 | * ::MHD_USE_INTERNAL_POLLING_THREAD is not set), you should call |
1837 | * performance is important (as it saves an expensive call to | 1843 | * #MHD_run_from_select if performance is important (as it saves an |
1838 | * `select()`). | 1844 | * expensive call to `select()`). |
1839 | * | 1845 | * |
1840 | * @param daemon daemon to run | 1846 | * @param daemon daemon to run |
1841 | * @return #MHD_YES on success, #MHD_NO if this | 1847 | * @return #MHD_YES on success, #MHD_NO if this |