[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/05: MHD_set_connection_option(): improved readability
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/05: MHD_set_connection_option(): improved readability |
Date: |
Sun, 31 Oct 2021 15:42:00 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit e1d1558570b8beb3fe32fc86a39e7d430e54f587
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 31 17:21:51 2021 +0300
MHD_set_connection_option(): improved readability
Fixed error reporting
---
src/microhttpd/connection.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 83677c14..b5724f5b 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -4852,6 +4852,7 @@ MHD_set_connection_option (struct MHD_Connection
*connection,
{
va_list ap;
struct MHD_Daemon *daemon;
+ unsigned int ui_val;
daemon = connection->daemon;
switch (option)
@@ -4875,25 +4876,24 @@ MHD_set_connection_option (struct MHD_Connection
*connection,
connection);
}
va_start (ap, option);
- connection->connection_timeout_ms = va_arg (ap,
- unsigned int);
+ ui_val = va_arg (ap, unsigned int);
va_end (ap);
#if (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT
- if ((UINT64_MAX / 2000 - 1) < connection->connection_timeout_ms)
+ if ((UINT64_MAX / 2000 - 1) < ui_val)
{
#ifdef HAVE_MESSAGES
MHD_DLOG (connection->daemon,
- _ ("The specified connection timeout (" PRIu64 ") is too " \
- "large. Maximum allowed value (" PRIu64 ") will be used " \
+ _ ("The specified connection timeout (%u) is too " \
+ "large. Maximum allowed value (%" PRIu64 ") will be used " \
"instead.\n"),
- connection->connection_timeout_ms,
+ ui_val,
(UINT64_MAX / 2000 - 1));
#endif
- connection->connection_timeout_ms = UINT64_MAX / 2000 - 1;
+ ui_val = UINT64_MAX / 2000 - 1;
}
else
#endif /* (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT */
- connection->connection_timeout_ms *= 1000;
+ connection->connection_timeout_ms = ui_val * 1000;
if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
(! connection->suspended) )
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.