diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-11-07 23:15:42 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-11-08 00:54:59 +0300 |
commit | a48ca85fb74479a8a81e137138a30fab58f3eb1e (patch) | |
tree | 9089a6392d1c21466259a46f7139c18644274e5a /src/microhttpd | |
parent | 4e4a1ce2bb9f6cd1d38fdc5f169d8956afab70c0 (diff) | |
download | libmicrohttpd-a48ca85fb74479a8a81e137138a30fab58f3eb1e.tar.gz libmicrohttpd-a48ca85fb74479a8a81e137138a30fab58f3eb1e.zip |
Renamed daemon flags:
MHD_USE_SELECT_INTERNALLY -> MHD_USE_INTERNAL_POLLING_THREAD
MHD_USE_POLL_INTERNALLY -> MHD_USE_POLL_INTERNAL_THREAD
MHD_USE_EPOLL_INTERNALLY -> MHD_USE_EPOLL_INTERNAL_THREAD
Diffstat (limited to 'src/microhttpd')
-rw-r--r-- | src/microhttpd/connection.c | 4 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 24 | ||||
-rw-r--r-- | src/microhttpd/test_daemon.c | 4 | ||||
-rw-r--r-- | src/microhttpd/test_upgrade.c | 14 |
4 files changed, 23 insertions, 23 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 4be4a258..f256cb8f 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -1411,7 +1411,7 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
1411 | { | 1411 | { |
1412 | if ((MHD_YES != try_grow_read_buffer (connection)) && | 1412 | if ((MHD_YES != try_grow_read_buffer (connection)) && |
1413 | (0 != (connection->daemon->options & | 1413 | (0 != (connection->daemon->options & |
1414 | (MHD_USE_SELECT_INTERNALLY | | 1414 | (MHD_USE_INTERNAL_POLLING_THREAD | |
1415 | MHD_USE_THREAD_PER_CONNECTION)))) | 1415 | MHD_USE_THREAD_PER_CONNECTION)))) |
1416 | { | 1416 | { |
1417 | /* failed to grow the read buffer, and the | 1417 | /* failed to grow the read buffer, and the |
@@ -2009,7 +2009,7 @@ process_request_body (struct MHD_Connection *connection) | |||
2009 | the setup was incorrect, which may prevent us from | 2009 | the setup was incorrect, which may prevent us from |
2010 | handling the rest of the request */ | 2010 | handling the rest of the request */ |
2011 | if ( ( (0 != (connection->daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || | 2011 | if ( ( (0 != (connection->daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || |
2012 | (0 != (connection->daemon->options & MHD_USE_SELECT_INTERNALLY)) ) && | 2012 | (0 != (connection->daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) ) && |
2013 | (MHD_NO == connection->suspended) ) | 2013 | (MHD_NO == connection->suspended) ) |
2014 | MHD_DLOG (connection->daemon, | 2014 | MHD_DLOG (connection->daemon, |
2015 | _("WARNING: incomplete POST processing and connection not suspended will result in hung connection.\n")); | 2015 | _("WARNING: incomplete POST processing and connection not suspended will result in hung connection.\n")); |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index d7691754..59973c86 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2957,8 +2957,8 @@ MHD_run_from_select (struct MHD_Daemon *daemon, | |||
2957 | struct MHD_UpgradeResponseHandle *urh; | 2957 | struct MHD_UpgradeResponseHandle *urh; |
2958 | struct MHD_UpgradeResponseHandle *urhn; | 2958 | struct MHD_UpgradeResponseHandle *urhn; |
2959 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ | 2959 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ |
2960 | unsigned int mask = MHD_ALLOW_SUSPEND_RESUME | MHD_USE_EPOLL_INTERNALLY | | 2960 | unsigned int mask = MHD_ALLOW_SUSPEND_RESUME | MHD_USE_EPOLL_INTERNAL_THREAD | |
2961 | MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION; | 2961 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_POLL_INTERNAL_THREAD | MHD_USE_THREAD_PER_CONNECTION; |
2962 | 2962 | ||
2963 | /* Clear ITC to avoid spinning select */ | 2963 | /* Clear ITC to avoid spinning select */ |
2964 | /* Do it before any other processing so new signals | 2964 | /* Do it before any other processing so new signals |
@@ -3904,7 +3904,7 @@ MHD_run (struct MHD_Daemon *daemon) | |||
3904 | { | 3904 | { |
3905 | if ( (MHD_YES == daemon->shutdown) || | 3905 | if ( (MHD_YES == daemon->shutdown) || |
3906 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || | 3906 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || |
3907 | (0 != (daemon->options & MHD_USE_SELECT_INTERNALLY)) ) | 3907 | (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) ) |
3908 | return MHD_NO; | 3908 | return MHD_NO; |
3909 | if (0 != (daemon->options & MHD_USE_POLL)) | 3909 | if (0 != (daemon->options & MHD_USE_POLL)) |
3910 | { | 3910 | { |
@@ -4089,7 +4089,7 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon) | |||
4089 | if (MHD_INVALID_SOCKET == ret) | 4089 | if (MHD_INVALID_SOCKET == ret) |
4090 | return MHD_INVALID_SOCKET; | 4090 | return MHD_INVALID_SOCKET; |
4091 | if ( (MHD_ITC_IS_INVALID_(daemon->itc)) && | 4091 | if ( (MHD_ITC_IS_INVALID_(daemon->itc)) && |
4092 | (0 != (daemon->options & (MHD_USE_SELECT_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION))) ) | 4092 | (0 != (daemon->options & (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_THREAD_PER_CONNECTION))) ) |
4093 | { | 4093 | { |
4094 | #ifdef HAVE_MESSAGES | 4094 | #ifdef HAVE_MESSAGES |
4095 | MHD_DLOG (daemon, | 4095 | MHD_DLOG (daemon, |
@@ -4786,7 +4786,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
4786 | #else | 4786 | #else |
4787 | use_itc = 1; /* yes, must use ITC to signal thread */ | 4787 | use_itc = 1; /* yes, must use ITC to signal thread */ |
4788 | #endif | 4788 | #endif |
4789 | if (0 == (flags & (MHD_USE_SELECT_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION))) | 4789 | if (0 == (flags & (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_THREAD_PER_CONNECTION))) |
4790 | use_itc = 0; /* useless if we are using 'external' select */ | 4790 | use_itc = 0; /* useless if we are using 'external' select */ |
4791 | if (use_itc) | 4791 | if (use_itc) |
4792 | { | 4792 | { |
@@ -4890,18 +4890,18 @@ MHD_start_daemon_va (unsigned int flags, | |||
4890 | #endif | 4890 | #endif |
4891 | 4891 | ||
4892 | /* Thread pooling currently works only with internal select thread model */ | 4892 | /* Thread pooling currently works only with internal select thread model */ |
4893 | if ( (0 == (flags & MHD_USE_SELECT_INTERNALLY)) && | 4893 | if ( (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD)) && |
4894 | (daemon->worker_pool_size > 0) ) | 4894 | (daemon->worker_pool_size > 0) ) |
4895 | { | 4895 | { |
4896 | #ifdef HAVE_MESSAGES | 4896 | #ifdef HAVE_MESSAGES |
4897 | MHD_DLOG (daemon, | 4897 | MHD_DLOG (daemon, |
4898 | _("MHD thread pooling only works with MHD_USE_SELECT_INTERNALLY\n")); | 4898 | _("MHD thread pooling only works with MHD_USE_INTERNAL_POLLING_THREAD\n")); |
4899 | #endif | 4899 | #endif |
4900 | goto free_and_fail; | 4900 | goto free_and_fail; |
4901 | } | 4901 | } |
4902 | 4902 | ||
4903 | #ifdef __SYMBIAN32__ | 4903 | #ifdef __SYMBIAN32__ |
4904 | if (0 != (flags & (MHD_USE_SELECT_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION))) | 4904 | if (0 != (flags & (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_THREAD_PER_CONNECTION))) |
4905 | { | 4905 | { |
4906 | #ifdef HAVE_MESSAGES | 4906 | #ifdef HAVE_MESSAGES |
4907 | MHD_DLOG (daemon, | 4907 | MHD_DLOG (daemon, |
@@ -5234,7 +5234,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
5234 | } | 5234 | } |
5235 | #endif /* HTTPS_SUPPORT */ | 5235 | #endif /* HTTPS_SUPPORT */ |
5236 | if ( ( (0 != (flags & MHD_USE_THREAD_PER_CONNECTION)) || | 5236 | if ( ( (0 != (flags & MHD_USE_THREAD_PER_CONNECTION)) || |
5237 | ( (0 != (flags & MHD_USE_SELECT_INTERNALLY)) && | 5237 | ( (0 != (flags & MHD_USE_INTERNAL_POLLING_THREAD)) && |
5238 | (0 == daemon->worker_pool_size)) ) && | 5238 | (0 == daemon->worker_pool_size)) ) && |
5239 | (0 == (daemon->options & MHD_USE_NO_LISTEN_SOCKET)) && | 5239 | (0 == (daemon->options & MHD_USE_NO_LISTEN_SOCKET)) && |
5240 | (! MHD_create_named_thread_ (&daemon->pid, | 5240 | (! MHD_create_named_thread_ (&daemon->pid, |
@@ -5282,7 +5282,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
5282 | 5282 | ||
5283 | memcpy (d, daemon, sizeof (struct MHD_Daemon)); | 5283 | memcpy (d, daemon, sizeof (struct MHD_Daemon)); |
5284 | /* Adjust pooling params for worker daemons; note that memcpy() | 5284 | /* Adjust pooling params for worker daemons; note that memcpy() |
5285 | has already copied MHD_USE_SELECT_INTERNALLY thread model into | 5285 | has already copied MHD_USE_INTERNAL_POLLING_THREAD thread model into |
5286 | the worker threads. */ | 5286 | the worker threads. */ |
5287 | d->master = daemon; | 5287 | d->master = daemon; |
5288 | d->worker_pool_size = 0; | 5288 | d->worker_pool_size = 0; |
@@ -5365,7 +5365,7 @@ thread_failed: | |||
5365 | /* If no worker threads created, then shut down normally. Calling | 5365 | /* If no worker threads created, then shut down normally. Calling |
5366 | MHD_stop_daemon (as we do below) doesn't work here since it | 5366 | MHD_stop_daemon (as we do below) doesn't work here since it |
5367 | assumes a 0-sized thread pool means we had been in the default | 5367 | assumes a 0-sized thread pool means we had been in the default |
5368 | MHD_USE_SELECT_INTERNALLY mode. */ | 5368 | MHD_USE_INTERNAL_POLLING_THREAD mode. */ |
5369 | if (0 == i) | 5369 | if (0 == i) |
5370 | { | 5370 | { |
5371 | if (MHD_INVALID_SOCKET != socket_fd) | 5371 | if (MHD_INVALID_SOCKET != socket_fd) |
@@ -5619,7 +5619,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
5619 | fd = daemon->socket_fd; | 5619 | fd = daemon->socket_fd; |
5620 | daemon->socket_fd = MHD_INVALID_SOCKET; | 5620 | daemon->socket_fd = MHD_INVALID_SOCKET; |
5621 | 5621 | ||
5622 | if ( (0 != (daemon->options & MHD_USE_SELECT_INTERNALLY)) || | 5622 | if ( (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || |
5623 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) ) | 5623 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) ) |
5624 | { | 5624 | { |
5625 | /* Separate thread(s) is used for select()/poll()/etc. */ | 5625 | /* Separate thread(s) is used for select()/poll()/etc. */ |
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c index ca1f71bc..4692085e 100644 --- a/src/microhttpd/test_daemon.c +++ b/src/microhttpd/test_daemon.c | |||
@@ -75,7 +75,7 @@ testStartStop () | |||
75 | { | 75 | { |
76 | struct MHD_Daemon *d; | 76 | struct MHD_Daemon *d; |
77 | 77 | ||
78 | d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG, | 78 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_DEBUG, |
79 | 1080, | 79 | 1080, |
80 | &apc_nothing, | 80 | &apc_nothing, |
81 | NULL, &ahc_nothing, NULL, MHD_OPTION_END); | 81 | NULL, &ahc_nothing, NULL, MHD_OPTION_END); |
@@ -124,7 +124,7 @@ static int | |||
124 | testThread () | 124 | testThread () |
125 | { | 125 | { |
126 | struct MHD_Daemon *d; | 126 | struct MHD_Daemon *d; |
127 | d = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_SELECT_INTERNALLY, | 127 | d = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_INTERNAL_POLLING_THREAD, |
128 | 1082, | 128 | 1082, |
129 | &apc_all, NULL, &ahc_nothing, NULL, MHD_OPTION_END); | 129 | &apc_all, NULL, &ahc_nothing, NULL, MHD_OPTION_END); |
130 | 130 | ||
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c index 6ca9e7dc..b29ab72a 100644 --- a/src/microhttpd/test_upgrade.c +++ b/src/microhttpd/test_upgrade.c | |||
@@ -1064,7 +1064,7 @@ test_upgrade (int flags, | |||
1064 | &run_usock_client, | 1064 | &run_usock_client, |
1065 | &sock)) | 1065 | &sock)) |
1066 | abort (); | 1066 | abort (); |
1067 | if (0 == (flags & (MHD_USE_SELECT_INTERNALLY | | 1067 | if (0 == (flags & (MHD_USE_INTERNAL_POLLING_THREAD | |
1068 | MHD_USE_THREAD_PER_CONNECTION)) ) | 1068 | MHD_USE_THREAD_PER_CONNECTION)) ) |
1069 | run_mhd_loop (d, flags); | 1069 | run_mhd_loop (d, flags); |
1070 | pthread_join (pt_client, | 1070 | pthread_join (pt_client, |
@@ -1176,14 +1176,14 @@ main (int argc, | |||
1176 | #endif /* HAVE_POLL */ | 1176 | #endif /* HAVE_POLL */ |
1177 | 1177 | ||
1178 | /* Test different event loops, with and without thread pool */ | 1178 | /* Test different event loops, with and without thread pool */ |
1179 | res = test_upgrade (MHD_USE_SELECT_INTERNALLY, | 1179 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, |
1180 | 0); | 1180 | 0); |
1181 | error_count += res; | 1181 | error_count += res; |
1182 | if (res) | 1182 | if (res) |
1183 | fprintf (stderr, "FAILED: Upgrade with internal select, return code %d.\n", res); | 1183 | fprintf (stderr, "FAILED: Upgrade with internal select, return code %d.\n", res); |
1184 | else if (verbose) | 1184 | else if (verbose) |
1185 | printf ("PASSED: Upgrade with internal select.\n"); | 1185 | printf ("PASSED: Upgrade with internal select.\n"); |
1186 | res = test_upgrade (MHD_USE_SELECT_INTERNALLY, | 1186 | res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD, |
1187 | 2); | 1187 | 2); |
1188 | error_count += res; | 1188 | error_count += res; |
1189 | if (res) | 1189 | if (res) |
@@ -1191,14 +1191,14 @@ main (int argc, | |||
1191 | else if (verbose) | 1191 | else if (verbose) |
1192 | printf ("PASSED: Upgrade with internal select with thread pool.\n"); | 1192 | printf ("PASSED: Upgrade with internal select with thread pool.\n"); |
1193 | #ifdef HAVE_POLL | 1193 | #ifdef HAVE_POLL |
1194 | res = test_upgrade (MHD_USE_POLL_INTERNALLY, | 1194 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, |
1195 | 0); | 1195 | 0); |
1196 | error_count += res; | 1196 | error_count += res; |
1197 | if (res) | 1197 | if (res) |
1198 | fprintf (stderr, "FAILED: Upgrade with internal poll, return code %d.\n", res); | 1198 | fprintf (stderr, "FAILED: Upgrade with internal poll, return code %d.\n", res); |
1199 | else if (verbose) | 1199 | else if (verbose) |
1200 | printf ("PASSED: Upgrade with internal poll.\n"); | 1200 | printf ("PASSED: Upgrade with internal poll.\n"); |
1201 | res = test_upgrade (MHD_USE_POLL_INTERNALLY, | 1201 | res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD, |
1202 | 2); | 1202 | 2); |
1203 | if (res) | 1203 | if (res) |
1204 | fprintf (stderr, "FAILED: Upgrade with internal poll with thread pool, return code %d.\n", res); | 1204 | fprintf (stderr, "FAILED: Upgrade with internal poll with thread pool, return code %d.\n", res); |
@@ -1206,13 +1206,13 @@ main (int argc, | |||
1206 | printf ("PASSED: Upgrade with internal poll with thread pool.\n"); | 1206 | printf ("PASSED: Upgrade with internal poll with thread pool.\n"); |
1207 | #endif | 1207 | #endif |
1208 | #ifdef EPOLL_SUPPORT | 1208 | #ifdef EPOLL_SUPPORT |
1209 | res = test_upgrade (MHD_USE_EPOLL_INTERNALLY, | 1209 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, |
1210 | 0); | 1210 | 0); |
1211 | if (res) | 1211 | if (res) |
1212 | fprintf (stderr, "FAILED: Upgrade with internal epoll, return code %d.\n", res); | 1212 | fprintf (stderr, "FAILED: Upgrade with internal epoll, return code %d.\n", res); |
1213 | else if (verbose) | 1213 | else if (verbose) |
1214 | printf ("PASSED: Upgrade with internal epoll.\n"); | 1214 | printf ("PASSED: Upgrade with internal epoll.\n"); |
1215 | res = test_upgrade (MHD_USE_EPOLL_INTERNALLY, | 1215 | res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD, |
1216 | 2); | 1216 | 2); |
1217 | if (res) | 1217 | if (res) |
1218 | fprintf (stderr, "FAILED: Upgrade with internal epoll, return code %d.\n", res); | 1218 | fprintf (stderr, "FAILED: Upgrade with internal epoll, return code %d.\n", res); |