[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 10/13: Use new function MHD_get_timeout64() in MHD code
From: |
gnunet |
Subject: |
[libmicrohttpd] 10/13: Use new function MHD_get_timeout64() in MHD code |
Date: |
Wed, 27 Apr 2022 21:25:18 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 18581f1694f1249c3862358e126aebb266fc448a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Apr 27 17:33:25 2022 +0300
Use new function MHD_get_timeout64() in MHD code
---
src/microhttpd/daemon.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index cbbd1680..7e2b6284 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4445,34 +4445,32 @@ MHD_select (struct MHD_Daemon *daemon,
}
else
{
- MHD_UNSIGNED_LONG_LONG ltimeout;
+ uint64_t timeout64;
if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (MHD_NO != MHD_get_timeout (daemon, <imeout)) )
+ (MHD_NO != MHD_get_timeout64 (daemon, &timeout64)) )
{
tv = &timeout; /* have timeout value */
if ( (0 < millisec) &&
- (ltimeout > (MHD_UNSIGNED_LONG_LONG) millisec) )
- ltimeout = (MHD_UNSIGNED_LONG_LONG) millisec;
+ (timeout64 > (uint64_t) millisec) )
+ timeout64 = (uint64_t) millisec;
}
else if (0 < millisec)
{
tv = &timeout; /* have timeout value */
- ltimeout = (MHD_UNSIGNED_LONG_LONG) millisec;
+ timeout64 = (uint64_t) millisec;
}
if (NULL != tv)
{ /* have timeout value */
- if (ltimeout / 1000 > TIMEVAL_TV_SEC_MAX)
- {
+#if (SIZEOF_UINT64_T - 2) >= SIZEOF_STRUCT_TIMEVAL_TV_SEC
+ if (timeout64 / 1000 > TIMEVAL_TV_SEC_MAX)
timeout.tv_sec = TIMEVAL_TV_SEC_MAX;
- timeout.tv_usec = 0;
- }
else
- {
- timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) (ltimeout / 1000);
- timeout.tv_usec = (ltimeout % 1000) * 1000;
- }
+#endif /* (SIZEOF_UINT64_T - 2) >= SIZEOF_STRUCT_TIMEVAL_TV_SEC */
+ timeout.tv_sec = (_MHD_TIMEVAL_TV_SEC_TYPE) (timeout64 / 1000);
+
+ timeout.tv_usec = ((uint16_t) (timeout64 % 1000)) * ((int32_t) 1000);
}
}
num_ready = MHD_SYS_select_ (maxsock + 1,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (54e12358 -> d14fc3b3), gnunet, 2022/04/27
- [libmicrohttpd] 04/13: thread-per-connection: do not cache connection timeout, gnunet, 2022/04/27
- [libmicrohttpd] 03/13: Response from callback: do allow negative return amounts, except predefined values, gnunet, 2022/04/27
- [libmicrohttpd] 01/13: MHD_itc_clear_(): simplified eventfd version, gnunet, 2022/04/27
- [libmicrohttpd] 08/13: Added new function MHD_get_timeout64s(), gnunet, 2022/04/27
- [libmicrohttpd] 02/13: Fixed compiler warnings of implicit casting, which could change the value, gnunet, 2022/04/27
- [libmicrohttpd] 06/13: Added new function MHD_get_timeout64(), gnunet, 2022/04/27
- [libmicrohttpd] 09/13: daemon: added workaround for 'uncrustify' broken formatting, gnunet, 2022/04/27
- [libmicrohttpd] 07/13: get_timeout_millisec_(): refactoring for readability, gnunet, 2022/04/27
- [libmicrohttpd] 05/13: thread-per-connection: improved timeout handling for 'poll()' mode, fixed short busy-waiting, gnunet, 2022/04/27
- [libmicrohttpd] 10/13: Use new function MHD_get_timeout64() in MHD code,
gnunet <=
- [libmicrohttpd] 11/13: mhd_send: added safe default value if sysconf() is broken, gnunet, 2022/04/27
- [libmicrohttpd] 12/13: Fixes related to implicit cast warnings, gnunet, 2022/04/27
- [libmicrohttpd] 13/13: MHD_get_timeout*(): improved doxy, gnunet, 2022/04/27