summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan-Michael Brummer <jan.brummer@tabos.org>2023-03-09 17:34:02 +0100
committerJan-Michael Brummer <jan.brummer@tabos.org>2023-03-27 16:31:58 +0200
commitc23a1345e9c75a0e1ae7d5d5affcc6af5df24d38 (patch)
treecdab72f43a092b3a4c0044adecc041bd39912d63 /src
parente7713214c85ded42112aefdd05bf7af37a80fd6e (diff)
downloadlibproxy-git-c23a1345e9c75a0e1ae7d5d5affcc6af5df24d38.tar.gz
Add flag to toggle curl integration (#65)
In order to fix a possible build cycle between libproxy and curl add a toggle to switch off curl if necessary. Fixes: https://github.com/janbrummer/libproxy2/issues/57
Diffstat (limited to 'src')
-rw-r--r--src/backend/px-manager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/px-manager.c b/src/backend/px-manager.c
index f69dab3..ad230ac 100644
--- a/src/backend/px-manager.c
+++ b/src/backend/px-manager.c
@@ -25,7 +25,9 @@
#include "px-plugin-config.h"
#include "px-plugin-pacrunner.h"
+#ifdef HAVE_CURL
#include <curl/curl.h>
+#endif
#include <libpeas/peas.h>
enum {
@@ -51,7 +53,9 @@ struct _PxManager {
PeasExtensionSet *config_set;
PeasExtensionSet *pacrunner_set;
GNetworkMonitor *network_monitor;
+#ifdef HAVE_CURL
CURL *curl;
+#endif
char *plugins_dir;
GCancellable *cancellable;
@@ -309,6 +313,7 @@ GBytes *
px_manager_pac_download (PxManager *self,
const char *uri)
{
+#ifdef HAVE_CURL
GByteArray *byte_array = g_byte_array_new ();
CURLcode res;
const char *url = uri;
@@ -339,6 +344,9 @@ px_manager_pac_download (PxManager *self,
}
return g_byte_array_free_to_bytes (byte_array);
+#else
+ return NULL;
+#endif
}
struct ConfigData {