diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-04-27 14:20:16 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-04-27 22:11:54 +0300 |
commit | f3d7ef1f5f1fc9d4e7c24ca3d0ff56dd381e644b (patch) | |
tree | 33fa81f56b48a74c852b8be757fc403106c6466f | |
parent | 0424af2a045c0266155b76da868ff668c8e9bfbc (diff) | |
download | libmicrohttpd-f3d7ef1f5f1fc9d4e7c24ca3d0ff56dd381e644b.tar.gz libmicrohttpd-f3d7ef1f5f1fc9d4e7c24ca3d0ff56dd381e644b.zip |
thread-per-connection: do not cache connection timeout
The timeout value could be updated by application
-rw-r--r-- | src/microhttpd/daemon.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 241d06b1..e9207490 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1922,7 +1922,6 @@ thread_main_handle_connection (void *data) | |||
1922 | while ( (! daemon->shutdown) && | 1922 | while ( (! daemon->shutdown) && |
1923 | (MHD_CONNECTION_CLOSED != con->state) ) | 1923 | (MHD_CONNECTION_CLOSED != con->state) ) |
1924 | { | 1924 | { |
1925 | uint64_t timeout = con->connection_timeout_ms; | ||
1926 | #ifdef UPGRADE_SUPPORT | 1925 | #ifdef UPGRADE_SUPPORT |
1927 | struct MHD_UpgradeResponseHandle *const urh = con->urh; | 1926 | struct MHD_UpgradeResponseHandle *const urh = con->urh; |
1928 | #else /* ! UPGRADE_SUPPORT */ | 1927 | #else /* ! UPGRADE_SUPPORT */ |
@@ -2016,7 +2015,7 @@ thread_main_handle_connection (void *data) | |||
2016 | tvp = &tv; | 2015 | tvp = &tv; |
2017 | } | 2016 | } |
2018 | if ( (NULL == tvp) && | 2017 | if ( (NULL == tvp) && |
2019 | (timeout > 0) ) | 2018 | (con->connection_timeout_ms > 0) ) |
2020 | { | 2019 | { |
2021 | const uint64_t mseconds_left = connection_get_wait (con); | 2020 | const uint64_t mseconds_left = connection_get_wait (con); |
2022 | #if (SIZEOF_UINT64_T - 2) >= SIZEOF_STRUCT_TIMEVAL_TV_SEC | 2021 | #if (SIZEOF_UINT64_T - 2) >= SIZEOF_STRUCT_TIMEVAL_TV_SEC |