From c0abaa06f717a38ba15c24f10ee19fcc69b21537 Mon Sep 17 00:00:00 2001 From: David Perry Date: Thu, 7 Jan 2021 16:21:42 -0500 Subject: maxmind: add optional synchronous lookups When tshark enables synchronous resolution of IP addresses to names, forces calls to maxmind_db_lookup_ipv4()/_ipv6() to block-wait for the maxmind response. Proposed fix for #14691. --- epan/maxmind_db.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'epan/maxmind_db.h') diff --git a/epan/maxmind_db.h b/epan/maxmind_db.h index 1328b2a583..94e492d109 100644 --- a/epan/maxmind_db.h +++ b/epan/maxmind_db.h @@ -85,6 +85,18 @@ static inline gboolean maxmind_db_has_coords(const mmdb_lookup_t *result) result->longitude != DBL_MAX && result->latitude != DBL_MAX; } +/** + * Select whether lookups should be performed synchronously. + * Default is asynchronous lookups. + * + * @param synchronous Whether maxmind lookups should be synchronous. + * + * XXX - if we ever have per-session host name etc. information, we + * should probably have the "resolve synchronously or asynchronously" + * flag be per-session, set with an epan API. + */ +WS_DLL_PUBLIC void maxmind_db_set_synchrony(gboolean synchronous); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3