FossilOrigin-Name: 3ddbe980e2d152ef446c5a1482d49f13ae93471a7e6198640472b595bd5e7c92
This commit is contained in:
nekobit 2022-10-26 18:49:51 +00:00
parent 740fd220a0
commit a54e0cf0b3
8 changed files with 19 additions and 19 deletions

View file

@ -47,7 +47,7 @@ void mstdnt_fetch_data_cleanup(struct mstdnt_fetch_data* res);
* @param args Mastodont General args passed
* @param url URL of request
* @param results Results from response
* @return Number of connections in progress
* @return Number of connections in progress, or -1 on error
*/
int mstdnt_fetch_curl_async(mastodont_t* mstdnt,
CURL* curl,
@ -66,8 +66,8 @@ int mstdnt_fetch_curl_async(mastodont_t* mstdnt,
* @param mstdnt Mastodont struct
* @param opt Option, MSTDNT_AWAIT_ALL means it will keep going until
* there are no more transfers. MSTDNT_AWAIT_ONCE will run
int mstdnt_await(mstdnt_t* mstdnt, enum mstdnt_fetch_await opt)
{
}
* @return 1 on error
*/
int mstdnt_await(mastodont_t* mstdnt, enum mstdnt_fetch_await opt);
#endif /* MASTODONT_FETCH_H */

View file

@ -32,7 +32,7 @@ struct _mstdnt_val_ref
};
int _mstdnt_json_init(cJSON** root,
struct mstdnt_fetch_results* results,
struct mstdnt_fetch_data* results,
struct mstdnt_storage* storage);
int _mstdnt_key_val_ref(cJSON* v, struct _mstdnt_val_ref* refs,

View file

@ -19,11 +19,11 @@
#include "mastodont_fetch.h"
int mstdnt_instance_panel(mastodont_t* api,
struct mstdnt_args* args,
struct mstdnt_fetch_results* html);
struct mstdnt_args* args,
struct mstdnt_fetch_data* html);
int mstdnt_terms_of_service(mastodont_t* api,
struct mstdnt_args* args,
struct mstdnt_fetch_results* html);
struct mstdnt_args* args,
struct mstdnt_fetch_data* html);
#endif /* MSTDNT_STATIC_H */

View file

@ -131,14 +131,14 @@ int mstdnt_await(mastodont_t* mstdnt, enum mstdnt_fetch_await opt)
// Check if our socket is done
while ((msg = curl_multi_info_read(mstdnt->curl, &msgs_left)))
{
if (msg->msg == CURLMSG_DONE && msg->easy_handle == curl)
if (msg->msg == CURLMSG_DONE)
{
// Get easy info
curl_easy_getinfo(msg->curl, CURLINFO_PRIVATE, &data);
mstdnt_fetch_data_cleanup(&data);
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &data);
mstdnt_fetch_data_cleanup(data);
curl_multi_remove_handle(mstdnt->curl, curl);
curl_easy_cleanup(curl);
curl_multi_remove_handle(mstdnt->curl, msg->easy_handle);
curl_easy_cleanup(msg->easy_handle);
}
}
while (opt == MSTDNT_AWAIT_ALL && msgs_left);

View file

@ -24,7 +24,7 @@
#define TIMESTAMP_LEN 16
int _mstdnt_json_init(cJSON** root,
struct mstdnt_fetch_results* results,
struct mstdnt_fetch_data* results,
struct mstdnt_storage* storage)
{
*root = cJSON_ParseWithLengthOpts(results->response, results->size, NULL, 0);

View file

@ -162,7 +162,7 @@ void* cb_args,
mstdnt_list_json_callback
};
return mstdnt_request(data, m_args,&req_args);
return mstdnt_request(data, m_args, cb_request, cb_args, &req_args);
}
int mstdnt_update_list(mastodont_t* data,

View file

@ -83,7 +83,7 @@ static mstdnt_sync_request(mastodont_t* data,
int res = 0, curlerror = 0;
cJSON* root;
struct mstdnt_fetch_results results = { 0 };
struct mstdnt_fetch_data results = { 0 };
curlerror = mstdnt_fetch_curl(data,
curl,
m_args,

View file

@ -20,7 +20,7 @@ int mstdnt_instance_panel(mastodont_t* api,
struct mstdnt_args* m_args,
mstdnt_request_cb_t cb_request,
void* cb_args,
struct mstdnt_fetch_results* html)
struct mstdnt_fetch_data* html)
{
CURL* curl = curl_easy_init();
int status = mstdnt_fetch_curl(api,
@ -38,7 +38,7 @@ int mstdnt_terms_of_service(mastodont_t* api,
struct mstdnt_args* m_args,
mstdnt_request_cb_t cb_request,
void* cb_args,
struct mstdnt_fetch_results* html)
struct mstdnt_fetch_data* html)
{
CURL* curl = curl_easy_init();
int status = mstdnt_fetch_curl(api,