}
int pakfire_client_create(struct pakfire_client** client,
- struct pakfire_ctx* ctx, sd_event* loop, const char* url, const char* principal) {
+ struct pakfire_ctx* ctx, const char* url, const char* principal) {
struct pakfire_client* self = NULL;
char hostname[HOST_NAME_MAX];
int r;
// Initialize the reference counter
self->nrefs = 1;
- // Create a new HTTP client
- r = pakfire_httpclient_create(&self->httpclient, self->ctx, loop);
+ // Event Loop
+ r = pakfire_ctx_loop(self->ctx, &self->loop);
if (r < 0)
goto ERROR;
- // Store a reference to the event loop
- self->loop = pakfire_httpclient_get_loop(self->httpclient);
+ // Create a new HTTP client
+ r = pakfire_httpclient_create(&self->httpclient, self->ctx, NULL);
+ if (r < 0)
+ goto ERROR;
// Store the URL
r = pakfire_string_set(self->url, url);
struct pakfire_client;
#include <json.h>
-#include <systemd/sd-event.h>
#include <pakfire/ctx.h>
int pakfire_client_create(struct pakfire_client** client,
- struct pakfire_ctx* ctx, sd_event* loop, const char* url, const char* principal);
+ struct pakfire_ctx* ctx, const char* url, const char* principal);
struct pakfire_client* pakfire_client_ref(struct pakfire_client* client);
struct pakfire_client* pakfire_client_unref(struct pakfire_client* client);