From da0f4dc1ecc8cb2b951ce9adfd2fd494a5365e4e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 10 Jul 2026 10:28:45 +0000 Subject: [PATCH] client: Add function to launch a request Signed-off-by: Michael Tremer --- src/daemon/client.c | 13 +++++++++++++ src/daemon/client.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/daemon/client.c b/src/daemon/client.c index ef6a893..2d1ef45 100644 --- a/src/daemon/client.c +++ b/src/daemon/client.c @@ -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; +} diff --git a/src/daemon/client.h b/src/daemon/client.h index a3870ab..15497e0 100644 --- a/src/daemon/client.h +++ b/src/daemon/client.h @@ -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 */ -- 2.47.3