From b42d23ca020606d0d3becfa4e3343ed3f3c89578 Mon Sep 17 00:00:00 2001 From: nekobit Date: Tue, 1 Nov 2022 15:06:54 +0000 Subject: [PATCH] Fix return handling for async call FossilOrigin-Name: 4577e92f812490efaae1a5ffd4d947fedd90c4682bc7ead2c5c98ab609db8499 --- src/request.c | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/src/request.c b/src/request.c index f6297f1..9ee0602 100644 --- a/src/request.c +++ b/src/request.c @@ -96,32 +96,9 @@ static int mstdnt_sync_request(mastodont_t* data, if (curlerror != CURLE_OK) { - res = 1; - storage->error = (char*)curl_easy_strerror(curlerror); goto cleanup; } - // Create json structure - if (_mstdnt_json_init(&root, &results, storage)) - { - res = 1; - goto cleanup_res; - } - - // Make sure there is no error - if (!mstdnt_check_error(storage)) - { - /* Call our callback and do the large work */ - if (args->callback) res = args->callback(storage->root, args->args); - } - else - res = 1; - -cleanup_res: - mstdnt_fetch_results_cleanup(&results); -cleanup: - // Note: the fetch removed the handle from our multi handle - curl_easy_cleanup(curl); return res; } #endif @@ -181,32 +158,6 @@ int mstdnt_request(mastodont_t* data, // Mime already used, free it early if (mime) curl_mime_free(mime); - if (curlerror != CURLE_OK) - { - res = 1; - storage->error = (char*)curl_easy_strerror(curlerror); - goto cleanup; - } - - // Create json structure -#if 0 - if (_mstdnt_json_init(&root, &results, storage)) - { - res = 1; - goto cleanup_res; - } - - // Make sure there is no error - if (!mstdnt_check_error(storage)) - { - /* Call our callback and do the large work */ - if (args->callback) res = args->callback(storage->root, args->args); - } - else - res = 1; -#endif - -cleanup_res: cleanup: if (args->params_post && args->request_type == CURLOPT_POST)