Skip to content

Commit 15b451d

Browse files
committed
Recommit parts of "Minor fixes in MDNS code to make sure it does work after the recent loop tightening."
1 parent b32ee61 commit 15b451d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/context.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3569,10 +3569,12 @@ _get_context_settings(getdns_context* context)
35693569
return NULL;
35703570

35713571
/* int fields */
3572+
/* the timeouts are stored as uint64, but the value maximum used in
3573+
practice is 6553500ms, so we just trim the value to be on the safe side. */
35723574
if ( getdns_dict_set_int(result, "timeout",
3573-
context->timeout)
3575+
(context->timeout > 0xFFFFFFFFull) ? 0xFFFFFFFF: (uint32_t) context->timeout)
35743576
|| getdns_dict_set_int(result, "idle_timeout",
3575-
context->idle_timeout)
3577+
(context->idle_timeout > 0xFFFFFFFFull) ? 0xFFFFFFFF : (uint32_t) context->idle_timeout)
35763578
|| getdns_dict_set_int(result, "limit_outstanding_queries",
35773579
context->limit_outstanding_queries)
35783580
|| getdns_dict_set_int(result, "dnssec_allowed_skew",

src/util-internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ _getdns_create_call_reporting_dict(
862862
return NULL;
863863
}
864864
} else{
865-
uint32_t idle_timeout = netreq->upstream->keepalive_timeout;
865+
uint32_t idle_timeout = (uint32_t) netreq->upstream->keepalive_timeout;
866866
if (getdns_dict_set_int( netreq_debug, "idle timeout in ms", idle_timeout)) {
867867
getdns_dict_destroy(netreq_debug);
868868
return NULL;

0 commit comments

Comments
 (0)