From 4a23134e1e5d70a9c8c5857790dbf27585ca3b1f Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Fri, 29 Aug 2025 14:05:20 +0200 Subject: Discovery: Add cache argument and embed unmarshal on startup --- wrappers/python/eduvpn_common/loader.py | 4 ++-- wrappers/python/eduvpn_common/main.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'wrappers/python/eduvpn_common') diff --git a/wrappers/python/eduvpn_common/loader.py b/wrappers/python/eduvpn_common/loader.py index 6957c15..870f0b4 100644 --- a/wrappers/python/eduvpn_common/loader.py +++ b/wrappers/python/eduvpn_common/loader.py @@ -49,8 +49,8 @@ def initialize_functions(lib: CDLL) -> None: lib.Deregister.argtypes, lib.Deregister.restype = [], None lib.ExpiryTimes.argtypes, lib.ExpiryTimes.restype = [], DataError lib.FreeString.argtypes, lib.FreeString.restype = [c_void_p], None - lib.DiscoOrganizations.argtypes, lib.DiscoOrganizations.restype = [c_int, c_char_p], DataError - lib.DiscoServers.argtypes, lib.DiscoServers.restype = [c_int, c_char_p], DataError + lib.DiscoOrganizations.argtypes, lib.DiscoOrganizations.restype = [c_int, c_int, c_char_p], DataError + lib.DiscoServers.argtypes, lib.DiscoServers.restype = [c_int, c_int, c_char_p], DataError lib.GetConfig.argtypes, lib.GetConfig.restype = ( [ c_int, diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index 613dce2..334c8b8 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -194,14 +194,14 @@ class EduVPN(object): forwardError(server_err) return server - def get_disco_organizations(self, search="") -> str: - orgs, _ = self.go_cookie_function(self.lib.DiscoOrganizations, search) + def get_disco_organizations(self, cache: bool = False, search="") -> str: + orgs, _ = self.go_cookie_function(self.lib.DiscoOrganizations, cache, search) # We don't log anything here as we want to return a result and we don't want to throw here # we already log for errors in common return orgs - def get_disco_servers(self, search="") -> str: - servers, _ = self.go_cookie_function(self.lib.DiscoServers, search) + def get_disco_servers(self, cache: bool = False, search="") -> str: + servers, _ = self.go_cookie_function(self.lib.DiscoServers, cache, search) # We don't log anything here as we want to return a result and we don't want to throw here # we already log for errors in common return servers -- cgit v1.2.3