From 801a287884e03ad028e4c53eb1fe29c9c0961adf Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 27 Jun 2025 09:31:20 +0000 Subject: [PATCH] xfer: Remove more dead code Signed-off-by: Michael Tremer --- src/pakfire/xfer.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/src/pakfire/xfer.c b/src/pakfire/xfer.c index bda1b60f..a88cb82c 100644 --- a/src/pakfire/xfer.c +++ b/src/pakfire/xfer.c @@ -1832,39 +1832,3 @@ pakfire_xfer_error_code_t pakfire_xfer_run(struct pakfire_xfer* xfer, int flags) return r; } - -static int pakfire_xfer_handle_api_error( - struct pakfire_xfer* xfer, const struct json_object* error) { - struct json_object* message = NULL; - struct json_object* code = NULL; - const char* m = NULL; - unsigned int c = 0; - - // Fetch the URL - const char* url = pakfire_xfer_get_effective_url(xfer); - - // Fetch the code - if (!json_object_object_get_ex(error, "code", &code)) - return -EBADMSG; - - // Check if the code is an integer - if (!json_object_is_type(code, json_type_int)) - return -EBADMSG; - - // Fetch the message - if (!json_object_object_get_ex(error, "message", &message)) - return -EBADMSG; - - // Check if the message is a string - if (!json_object_is_type(message, json_type_string)) - return -EBADMSG; - - c = json_object_get_uint64(code); - m = json_object_get_string(message); - - // Log the error - ERROR(xfer->ctx, "%s responded with error %u (%s):\n %s\n", - url, c, strerror(c), m); - - return -c; -} -- 2.47.2