diff options
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 1c7368ad..02a2f143 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2350,8 +2350,8 @@ MHD_suspend_connection (struct MHD_Connection *connection) | |||
2350 | struct MHD_Daemon *daemon; | 2350 | struct MHD_Daemon *daemon; |
2351 | 2351 | ||
2352 | daemon = connection->daemon; | 2352 | daemon = connection->daemon; |
2353 | if (MHD_USE_SUSPEND_RESUME != (daemon->options & MHD_USE_SUSPEND_RESUME)) | 2353 | if (MHD_ALLOW_SUSPEND_RESUME != (daemon->options & MHD_ALLOW_SUSPEND_RESUME)) |
2354 | MHD_PANIC (_("Cannot suspend connections without enabling MHD_USE_SUSPEND_RESUME!\n")); | 2354 | MHD_PANIC (_("Cannot suspend connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n")); |
2355 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) | 2355 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) |
2356 | { | 2356 | { |
2357 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 2357 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
@@ -2415,8 +2415,8 @@ MHD_resume_connection (struct MHD_Connection *connection) | |||
2415 | struct MHD_Daemon *daemon; | 2415 | struct MHD_Daemon *daemon; |
2416 | 2416 | ||
2417 | daemon = connection->daemon; | 2417 | daemon = connection->daemon; |
2418 | if (MHD_USE_SUSPEND_RESUME != (daemon->options & MHD_USE_SUSPEND_RESUME)) | 2418 | if (MHD_ALLOW_SUSPEND_RESUME != (daemon->options & MHD_ALLOW_SUSPEND_RESUME)) |
2419 | MHD_PANIC (_("Cannot resume connections without enabling MHD_USE_SUSPEND_RESUME!\n")); | 2419 | MHD_PANIC (_("Cannot resume connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n")); |
2420 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) | 2420 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) |
2421 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 2421 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
2422 | connection->resuming = MHD_YES; | 2422 | connection->resuming = MHD_YES; |
@@ -2960,7 +2960,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon, | |||
2960 | struct MHD_UpgradeResponseHandle *urh; | 2960 | struct MHD_UpgradeResponseHandle *urh; |
2961 | struct MHD_UpgradeResponseHandle *urhn; | 2961 | struct MHD_UpgradeResponseHandle *urhn; |
2962 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ | 2962 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ |
2963 | unsigned int mask = MHD_USE_SUSPEND_RESUME | MHD_USE_EPOLL_INTERNALLY | | 2963 | unsigned int mask = MHD_ALLOW_SUSPEND_RESUME | MHD_USE_EPOLL_INTERNALLY | |
2964 | MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION; | 2964 | MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION; |
2965 | 2965 | ||
2966 | /* Clear ITC to avoid spinning select */ | 2966 | /* Clear ITC to avoid spinning select */ |
@@ -2972,7 +2972,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon, | |||
2972 | MHD_itc_clear_ (daemon->itc); | 2972 | MHD_itc_clear_ (daemon->itc); |
2973 | 2973 | ||
2974 | /* Resuming external connections when using an extern mainloop */ | 2974 | /* Resuming external connections when using an extern mainloop */ |
2975 | if (MHD_USE_SUSPEND_RESUME == (daemon->options & mask)) | 2975 | if (MHD_ALLOW_SUSPEND_RESUME == (daemon->options & mask)) |
2976 | resume_suspended_connections (daemon); | 2976 | resume_suspended_connections (daemon); |
2977 | 2977 | ||
2978 | #ifdef EPOLL_SUPPORT | 2978 | #ifdef EPOLL_SUPPORT |
@@ -3077,7 +3077,7 @@ MHD_select (struct MHD_Daemon *daemon, | |||
3077 | err_state = MHD_NO; | 3077 | err_state = MHD_NO; |
3078 | if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) | 3078 | if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) |
3079 | { | 3079 | { |
3080 | if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) && | 3080 | if ( (MHD_ALLOW_SUSPEND_RESUME == (daemon->options & MHD_ALLOW_SUSPEND_RESUME)) && |
3081 | (MHD_YES == resume_suspended_connections (daemon)) ) | 3081 | (MHD_YES == resume_suspended_connections (daemon)) ) |
3082 | may_block = MHD_NO; | 3082 | may_block = MHD_NO; |
3083 | 3083 | ||
@@ -3227,7 +3227,7 @@ MHD_poll_all (struct MHD_Daemon *daemon, | |||
3227 | struct MHD_UpgradeResponseHandle *urhn; | 3227 | struct MHD_UpgradeResponseHandle *urhn; |
3228 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ | 3228 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ |
3229 | 3229 | ||
3230 | if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) && | 3230 | if ( (MHD_ALLOW_SUSPEND_RESUME == (daemon->options & MHD_ALLOW_SUSPEND_RESUME)) && |
3231 | (MHD_YES == resume_suspended_connections (daemon)) ) | 3231 | (MHD_YES == resume_suspended_connections (daemon)) ) |
3232 | may_block = MHD_NO; | 3232 | may_block = MHD_NO; |
3233 | 3233 | ||
@@ -3839,7 +3839,7 @@ MHD_epoll (struct MHD_Daemon *daemon, | |||
3839 | 3839 | ||
3840 | /* we handle resumes here because we may have ready connections | 3840 | /* we handle resumes here because we may have ready connections |
3841 | that will not be placed into the epoll list immediately. */ | 3841 | that will not be placed into the epoll list immediately. */ |
3842 | if (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) | 3842 | if (MHD_ALLOW_SUSPEND_RESUME == (daemon->options & MHD_ALLOW_SUSPEND_RESUME)) |
3843 | (void) resume_suspended_connections (daemon); | 3843 | (void) resume_suspended_connections (daemon); |
3844 | 3844 | ||
3845 | /* process events for connections */ | 3845 | /* process events for connections */ |
@@ -4635,7 +4635,7 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon) | |||
4635 | if (-1 == daemon->epoll_fd) | 4635 | if (-1 == daemon->epoll_fd) |
4636 | return MHD_NO; | 4636 | return MHD_NO; |
4637 | #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT) | 4637 | #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT) |
4638 | if (0 != (MHD_USE_UPGRADE & daemon->options)) | 4638 | if (0 != (MHD_ALLOW_UPGRADE & daemon->options)) |
4639 | { | 4639 | { |
4640 | daemon->epoll_upgrade_fd = setup_epoll_fd (daemon); | 4640 | daemon->epoll_upgrade_fd = setup_epoll_fd (daemon); |
4641 | if (MHD_INVALID_SOCKET == daemon->epoll_upgrade_fd) | 4641 | if (MHD_INVALID_SOCKET == daemon->epoll_upgrade_fd) |
@@ -4736,10 +4736,10 @@ MHD_start_daemon_va (unsigned int flags, | |||
4736 | if (0 != (flags & MHD_USE_TCP_FASTOPEN)) | 4736 | if (0 != (flags & MHD_USE_TCP_FASTOPEN)) |
4737 | return NULL; | 4737 | return NULL; |
4738 | #endif | 4738 | #endif |
4739 | if (0 != (flags & MHD_USE_UPGRADE)) | 4739 | if (0 != (flags & MHD_ALLOW_UPGRADE)) |
4740 | { | 4740 | { |
4741 | #ifdef UPGRADE_SUPPORT | 4741 | #ifdef UPGRADE_SUPPORT |
4742 | flags |= MHD_USE_SUSPEND_RESUME; | 4742 | flags |= MHD_ALLOW_SUSPEND_RESUME; |
4743 | #else /* ! UPGRADE_SUPPORT */ | 4743 | #else /* ! UPGRADE_SUPPORT */ |
4744 | return NULL; | 4744 | return NULL; |
4745 | #endif /* ! UPGRADE_SUPPORT */ | 4745 | #endif /* ! UPGRADE_SUPPORT */ |
@@ -5445,7 +5445,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5445 | struct MHD_Connection *pos; | 5445 | struct MHD_Connection *pos; |
5446 | const bool used_thr_p_c = (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)); | 5446 | const bool used_thr_p_c = (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)); |
5447 | #ifdef UPGRADE_SUPPORT | 5447 | #ifdef UPGRADE_SUPPORT |
5448 | const bool upg_allowed = (0 != (daemon->options & MHD_USE_UPGRADE)); | 5448 | const bool upg_allowed = (0 != (daemon->options & MHD_ALLOW_UPGRADE)); |
5449 | #endif /* UPGRADE_SUPPORT */ | 5449 | #endif /* UPGRADE_SUPPORT */ |
5450 | #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT) | 5450 | #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT) |
5451 | struct MHD_UpgradeResponseHandle *urh; | 5451 | struct MHD_UpgradeResponseHandle *urh; |
@@ -5471,7 +5471,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5471 | running into the check for there not being any suspended | 5471 | running into the check for there not being any suspended |
5472 | connections left in case of a tight race with a recently | 5472 | connections left in case of a tight race with a recently |
5473 | resumed connection. */ | 5473 | resumed connection. */ |
5474 | if (0 != (MHD_USE_SUSPEND_RESUME & daemon->options)) | 5474 | if (0 != (MHD_ALLOW_SUSPEND_RESUME & daemon->options)) |
5475 | { | 5475 | { |
5476 | daemon->resuming = MHD_YES; /* Force check for pending resume. */ | 5476 | daemon->resuming = MHD_YES; /* Force check for pending resume. */ |
5477 | resume_suspended_connections (daemon); | 5477 | resume_suspended_connections (daemon); |
@@ -5621,7 +5621,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
5621 | if (NULL == daemon) | 5621 | if (NULL == daemon) |
5622 | return; | 5622 | return; |
5623 | 5623 | ||
5624 | if (0 != (MHD_USE_SUSPEND_RESUME & daemon->options)) | 5624 | if (0 != (MHD_ALLOW_SUSPEND_RESUME & daemon->options)) |
5625 | resume_suspended_connections (daemon); | 5625 | resume_suspended_connections (daemon); |
5626 | 5626 | ||
5627 | daemon->shutdown = MHD_YES; | 5627 | daemon->shutdown = MHD_YES; |