mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
use setTimeout for removing requests
This commit is contained in:
parent
1ad301b26c
commit
74c1e9d943
4 changed files with 24 additions and 14 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue