Merge branch 'main' into reclaimtls

This commit is contained in:
ading2210 2024-11-04 15:06:11 -05:00
commit 4ff2d179b0
9 changed files with 42 additions and 16 deletions

View file

@ -40,6 +40,7 @@ CURL* create_request(const char* url, int request_id, DataCallback data_callback
curl_easy_setopt(http_handle, CURLOPT_PRIVATE, request_info);
curl_easy_setopt(http_handle, CURLOPT_URL, url);
curl_easy_setopt(http_handle, CURLOPT_BUFFERSIZE, 512*1024);
//callbacks to pass the response data back to js
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, &write_function);

View file

@ -27,9 +27,10 @@ void session_perform(struct SessionInfo *session) {
}
}
void session_set_options(struct SessionInfo *session, int connections_limit, int cache_limit) {
void session_set_options(struct SessionInfo *session, int connections_limit, int cache_limit, int host_conn_limit) {
curl_multi_setopt(session->multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, connections_limit);
curl_multi_setopt(session->multi_handle, CURLMOPT_MAXCONNECTS, cache_limit);
curl_multi_setopt(session->multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, host_conn_limit);
}
void session_add_request(struct SessionInfo *session, CURL* http_handle) {