mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
Handle case where configured curl handle cache limit is 0
svn path=/trunk/netsurf/; revision=12420
This commit is contained in:
parent
1b8ff87c23
commit
54f6b3bffc
@ -497,12 +497,18 @@ void fetch_curl_cache_handle(CURL *handle, char *host)
|
|||||||
* memory (except the hostname) and without removing the entry from the
|
* memory (except the hostname) and without removing the entry from the
|
||||||
* ring and then re-inserting it, in order to be as efficient as we can.
|
* ring and then re-inserting it, in order to be as efficient as we can.
|
||||||
*/
|
*/
|
||||||
|
if (curl_handle_ring != NULL) {
|
||||||
h = curl_handle_ring;
|
h = curl_handle_ring;
|
||||||
curl_handle_ring = h->r_next;
|
curl_handle_ring = h->r_next;
|
||||||
curl_easy_cleanup(h->handle);
|
curl_easy_cleanup(h->handle);
|
||||||
h->handle = handle;
|
h->handle = handle;
|
||||||
free(h->host);
|
free(h->host);
|
||||||
h->host = strdup(host);
|
h->host = strdup(host);
|
||||||
|
} else {
|
||||||
|
/* Actually, we don't want to cache any handles */
|
||||||
|
curl_easy_cleanup(handle);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* The table isn't full yet, so make a shiny new handle to add to the ring */
|
/* The table isn't full yet, so make a shiny new handle to add to the ring */
|
||||||
|
Loading…
Reference in New Issue
Block a user