Skip to content

Commit

Permalink
Only use our PAC script execution resolver if on Linux.
Browse files Browse the repository at this point in the history
Other platforms support PAC script execution natively.
  • Loading branch information
nmoinvaz committed Jul 14, 2023
1 parent 4baf456 commit 521f1e9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
#include "log.h"
#include "resolver.h"
#include "resolver_i.h"
#include "resolver_posix.h"
#if defined(__APPLE__)
# include "resolver_mac.h"
#elif defined(__linux__)
# include "resolver_gnome3.h"
# ifdef PROXYRES_EXECUTE
# include "resolver_posix.h"
# endif
#elif defined(_WIN32)
# if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
# include "resolver_winxp.h"
Expand Down Expand Up @@ -249,6 +251,10 @@ bool proxy_resolver_global_init(void) {
/* Does not work for manually specified proxy auto-config urls
if (proxy_resolver_gnome3_global_init())
g_proxy_resolver.proxy_resolver_i = proxy_resolver_gnome3_get_interface();*/
# ifdef PROXYRES_EXECUTE
if (!g_proxy_resolver.proxy_resolver_i)
g_proxy_resolver.proxy_resolver_i = proxy_resolver_posix_get_interface();
# endif
#elif defined(_WIN32)
# if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
if (proxy_resolver_win8_global_init())
Expand All @@ -259,10 +265,6 @@ bool proxy_resolver_global_init(void) {
if (proxy_resolver_winrt_global_init())
g_proxy_resolver.proxy_resolver_i = proxy_resolver_winrt_get_interface();
# endif
#endif
#ifdef PROXYRES_EXECUTE
if (!g_proxy_resolver.proxy_resolver_i)
g_proxy_resolver.proxy_resolver_i = proxy_resolver_posix_get_interface();
#endif

if (!g_proxy_resolver.proxy_resolver_i) {
Expand All @@ -284,7 +286,7 @@ bool proxy_resolver_global_init(void) {
return false;
}

#ifdef PROXYRES_EXECUTE
#if defined(__linux__) && defined(PROXYRES_EXECUTE)
// Pass threadpool to posix resolver to immediately start wpad discovery
if (g_proxy_resolver.proxy_resolver_i == proxy_resolver_posix_get_interface()) {
if (!proxy_resolver_posix_init_ex(g_proxy_resolver.threadpool)) {
Expand Down

0 comments on commit 521f1e9

Please sign in to comment.