#include <pakfire/httpclient.h>
#include <pakfire/logging.h>
#include <pakfire/progress.h>
+#include <pakfire/string.h>
#include <pakfire/xfer.h>
// The number of concurrent downloads
struct pakfire_ctx* ctx;
int nrefs;
+ // Base URL
+ char baseurl[PATH_MAX];
+
// Event Loop
sd_event* loop;
int still_running;
return client->share;
}
+const char* pakfire_httpclient_get_baseurl(struct pakfire_httpclient* client) {
+ if (*client->baseurl)
+ return client->baseurl;
+
+ return NULL;
+}
+
+int pakfire_httpclient_set_baseurl(struct pakfire_httpclient* client, const char* baseurl) {
+ return pakfire_string_set(client->baseurl, baseurl);
+}
+
int pakfire_httpclient_create_xfer(struct pakfire_xfer** xfer,
struct pakfire_httpclient* client, const char* url) {
return pakfire_xfer_create(xfer, client->ctx, client, url);
sd_event* pakfire_httpclient_loop(struct pakfire_httpclient* client);
CURLSH* pakfire_httpclient_share(struct pakfire_httpclient* downloader);
+const char* pakfire_httpclient_get_baseurl(struct pakfire_httpclient* client);
+int pakfire_httpclient_set_baseurl(struct pakfire_httpclient* client, const char* baseurl);
+
int pakfire_httpclient_create_xfer(struct pakfire_xfer** xfer,
struct pakfire_httpclient* downloader, const char* url);