shared: move src/import/curl-util.h to src/shared/

Move more common definitions in the header file instead of repeating
them in bunch of places. src/import/curl-util.[ch] is renamed so that
it's shared more naturally with other components.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-04-15 21:27:39 +02:00
parent 0ba59c3d32
commit cdc8aadaed
7 changed files with 21 additions and 23 deletions
+1 -12
View File
@@ -11,6 +11,7 @@
#include "alloc-util.h"
#include "build.h"
#include "conf-parser.h"
#include "curl-util.h"
#include "daemon-util.h"
#include "env-file.h"
#include "extract-word.h"
@@ -81,18 +82,6 @@ static void close_fd_input(Uploader *u);
#define STATE_FILE "/var/lib/systemd/journal-upload/state"
#define easy_setopt(curl, log_level, opt, value) ({ \
CURLcode code = curl_easy_setopt(ASSERT_PTR(curl), opt, value); \
if (code) \
log_full(log_level, \
"curl_easy_setopt %s failed: %s", \
#opt, curl_easy_strerror(code)); \
!code; \
})
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CURL*, curl_easy_cleanup, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct curl_slist*, curl_slist_free_all, NULL);
static size_t output_callback(char *buf,
size_t size,
size_t nmemb,