-# This is the general configuration file for pakfire.
+# This is the general configuration file for Pakfire
-[downloader]
-# Pakfire can use a proxy for HTTP, HTTPS and FTP
+# Pakfire can use a proxy for HTTPS and HTTP
# If no proxy setting is configured, Pakfire will
# use the environment settings.
#proxy = http://192.168.180.1:800
static struct pakfire_transfer* pakfire_downloader_create_transfer(
struct pakfire_downloader* downloader, const char* baseurl, struct pakfire_mirrorlist* mirrors,
const char* title, const char* url, const char* path, enum pakfire_transfer_flags flags) {
+ struct pakfire_config* config = NULL;
+
DEBUG(downloader->pakfire, "Adding download of %s\n", url);
// Reset baseurl it points to an empty string
if (!transfer->handle)
goto ERROR;
+ // Fetch global configuration
+ config = pakfire_get_config(downloader->pakfire);
+
+ // Set global configuration
+ if (config) {
+ const char* proxy = pakfire_config_get(config, NULL, "proxy", NULL);
+ if (proxy) {
+ curl_easy_setopt(transfer->handle, CURLOPT_PROXY, proxy);
+ }
+ }
+
// Enable logging/debugging
curl_easy_setopt(transfer->handle, CURLOPT_VERBOSE, 0);
return transfer;
ERROR:
+ if (config)
+ pakfire_config_unref(config);
pakfire_transfer_free(transfer);
return NULL;