From 129d764977017157070b388b07d54cb6fadbf6e6 Mon Sep 17 00:00:00 2001 From: Jan-Michael Brummer Date: Tue, 22 Nov 2022 19:04:32 +0100 Subject: [PATCH] Check libproxy during session creation Give libproxy a chance to automatically set the correct proxy without additional client configuration. --- configure.ac | 8 ++++++++ src/ne_session.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index d2d4e069..c763992a 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,14 @@ if test "$enable_memleak" = "yes"; then ALLOW_INSTALL=memleak fi +AC_ARG_ENABLE(auto-libproxy, + AS_HELP_STRING([--enable-auto-libproxy], + [for using libproxy during session creation])) + +if test "$enable_auto_libproxy" = "yes"; then + AC_DEFINE(NE_ENABLE_AUTO_LIBPROXY, 1, [to use libproxy automatically]) +fi + # Enable tests for optional features TESTS="\$(BASIC_TESTS)" HELPERS="" diff --git a/src/ne_session.c b/src/ne_session.c index ec42611f..44fa7bc9 100644 --- a/src/ne_session.c +++ b/src/ne_session.c @@ -200,6 +200,10 @@ ne_session *ne_session_create(const char *scheme, /* Set flags which default to on: */ sess->flags[NE_SESSFLAG_PERSIST] = 1; +#ifdef NE_ENABLE_AUTO_LIBPROXY + ne_session_system_proxy(sess, 0); +#endif + return sess; }