]> git.ipfire.org Git - telemetry.git/commitdiff
client: Add function to launch a request
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 Jul 2026 10:28:45 +0000 (10:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 Jul 2026 10:28:45 +0000 (10:28 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/client.c
src/daemon/client.h

index ef6a893d4a687d6babc36c7a234f455dfc810aed..2d1ef45bb5427c34e85806b570982bc2ea9977c8 100644 (file)
@@ -401,3 +401,16 @@ td_client* td_client_unref(td_client* self) {
        td_client_free(self);
        return NULL;
 }
+
+int td_client_launch_request(td_client* self, td_request* request) {
+       int r;
+
+       // Add the handle to cURL
+       r = curl_multi_add_handle(self->curl, td_request_handle(request));
+       if (r) {
+               ERROR(self->ctx, "Adding handle failed: %s\n", curl_multi_strerror(r));
+               return -ENOTSUP;
+       }
+
+       return 0;
+}
index a3870ab19f907ee0e5faab8969a267cf721769b2..15497e0b98056bdc3530f3042c3c4e3725614101 100644 (file)
@@ -25,6 +25,7 @@ typedef struct td_client td_client;
 
 #include "ctx.h"
 #include "daemon.h"
+#include "request.h"
 
 int td_client_create(td_client** client,
                td_ctx* ctx, td_daemon* daemon);
@@ -32,4 +33,6 @@ int td_client_create(td_client** client,
 td_client* td_client_ref(td_client* self);
 td_client* td_client_unref(td_client* self);
 
+int td_client_launch_request(td_client* self, td_request* request);
+
 #endif /* TELEMETRY_CLIENT_H */