use setTimeout for removing requests

This commit is contained in:
ading2210 2024-03-21 12:57:48 -07:00
parent 1ad301b26c
commit 74c1e9d943
4 changed files with 24 additions and 14 deletions

View file

@ -55,6 +55,12 @@ CURL* create_request(const char* url, DataCallback data_callback, EndCallback en
return http_handle;
}
void request_cleanup(CURL* http_handle) {
struct RequestInfo *request_info = get_request_info(http_handle);
curl_easy_cleanup(http_handle);
free(request_info);
}
void finish_request(CURLMsg *curl_msg) {
CURL *http_handle = curl_msg->easy_handle;
struct RequestInfo *request_info = get_request_info(http_handle);

View file

@ -41,10 +41,7 @@ int session_get_active(struct SessionInfo *session) {
}
void session_remove_request(struct SessionInfo *session, CURL* http_handle) {
struct RequestInfo *request_info = get_request_info(http_handle);
curl_multi_remove_handle(session->multi_handle, http_handle);
curl_easy_cleanup(http_handle);
free(request_info);
}
void session_cleanup(struct SessionInfo *session) {