commit 0f20fe46ee4496165a3eacaef0e7c66a67e517d8
parent 67061d5ce2e8433dc97c75bca2711134b66fdc69
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 19 Jun 2023 14:13:15 +0300
Fixed possible timeout value trim on 32-bits platforms
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -6807,7 +6807,7 @@ MHD_set_connection_option (struct MHD_Connection *connection,
XDLL_remove (daemon->manual_timeout_head,
daemon->manual_timeout_tail,
connection);
- connection->connection_timeout_ms = ui_val * 1000;
+ connection->connection_timeout_ms = ((uint64_t) ui_val) * 1000;
if (connection->connection_timeout_ms == daemon->connection_timeout_ms)
XDLL_insert (daemon->normal_timeout_head,
daemon->normal_timeout_tail,
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -6308,7 +6308,7 @@ parse_options_va (struct MHD_Daemon *daemon,
uv = UINT64_MAX / 4000 - 1;
}
#endif /* (SIZEOF_UINT64_T - 2) <= SIZEOF_UNSIGNED_INT */
- daemon->connection_timeout_ms = uv * 1000;
+ daemon->connection_timeout_ms = ((uint64_t) uv) * 1000;
break;
case MHD_OPTION_NOTIFY_COMPLETED:
daemon->notify_completed = va_arg (ap,