lib: bump hash sizes to size_t
Follow-up to cc907e80a2 #13502
Cherry-picked from #13489
Closes #13601
This commit is contained in:
parent
25cbc2f79a
commit
a35bbe8977
@ -100,7 +100,7 @@ static void free_bundle_hash_entry(void *freethis)
|
|||||||
bundle_destroy(b);
|
bundle_destroy(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Curl_conncache_init(struct conncache *connc, int size)
|
int Curl_conncache_init(struct conncache *connc, size_t size)
|
||||||
{
|
{
|
||||||
/* allocate a new easy handle to use when closing cached connections */
|
/* allocate a new easy handle to use when closing cached connections */
|
||||||
connc->closure_handle = curl_easy_init();
|
connc->closure_handle = curl_easy_init();
|
||||||
|
|||||||
@ -85,7 +85,7 @@ struct connectbundle {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* returns 1 on error, 0 is fine */
|
/* returns 1 on error, 0 is fine */
|
||||||
int Curl_conncache_init(struct conncache *, int size);
|
int Curl_conncache_init(struct conncache *, size_t size);
|
||||||
void Curl_conncache_destroy(struct conncache *connc);
|
void Curl_conncache_destroy(struct conncache *connc);
|
||||||
|
|
||||||
/* return the correct bundle, to a host or a proxy */
|
/* return the correct bundle, to a host or a proxy */
|
||||||
|
|||||||
@ -1094,7 +1094,7 @@ static void freednsentry(void *freethis)
|
|||||||
/*
|
/*
|
||||||
* Curl_init_dnscache() inits a new DNS cache.
|
* Curl_init_dnscache() inits a new DNS cache.
|
||||||
*/
|
*/
|
||||||
void Curl_init_dnscache(struct Curl_hash *hash, int size)
|
void Curl_init_dnscache(struct Curl_hash *hash, size_t size)
|
||||||
{
|
{
|
||||||
Curl_hash_init(hash, size, Curl_hash_str, Curl_str_key_compare,
|
Curl_hash_init(hash, size, Curl_hash_str, Curl_str_key_compare,
|
||||||
freednsentry);
|
freednsentry);
|
||||||
|
|||||||
@ -166,7 +166,7 @@ void Curl_resolv_unlock(struct Curl_easy *data,
|
|||||||
struct Curl_dns_entry *dns);
|
struct Curl_dns_entry *dns);
|
||||||
|
|
||||||
/* init a new dns cache */
|
/* init a new dns cache */
|
||||||
void Curl_init_dnscache(struct Curl_hash *hash, int hashsize);
|
void Curl_init_dnscache(struct Curl_hash *hash, size_t hashsize);
|
||||||
|
|
||||||
/* prune old entries from the DNS cache */
|
/* prune old entries from the DNS cache */
|
||||||
void Curl_hostcache_prune(struct Curl_easy *data);
|
void Curl_hostcache_prune(struct Curl_easy *data);
|
||||||
|
|||||||
@ -364,7 +364,7 @@ static size_t hash_fd(void *key, size_t key_length, size_t slots_num)
|
|||||||
* per call."
|
* per call."
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void sh_init(struct Curl_hash *hash, int hashsize)
|
static void sh_init(struct Curl_hash *hash, size_t hashsize)
|
||||||
{
|
{
|
||||||
Curl_hash_init(hash, hashsize, hash_fd, fd_key_compare,
|
Curl_hash_init(hash, hashsize, hash_fd, fd_key_compare,
|
||||||
sh_freeentry);
|
sh_freeentry);
|
||||||
@ -381,9 +381,9 @@ static void multi_addmsg(struct Curl_multi *multi, struct Curl_message *msg)
|
|||||||
Curl_llist_append(&multi->msglist, msg, &msg->list);
|
Curl_llist_append(&multi->msglist, msg, &msg->list);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */
|
struct Curl_multi *Curl_multi_handle(size_t hashsize, /* socket hash */
|
||||||
int chashsize, /* connection hash */
|
size_t chashsize, /* connection hash */
|
||||||
int dnssize) /* dns hash */
|
size_t dnssize) /* dns hash */
|
||||||
{
|
{
|
||||||
struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi));
|
struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi));
|
||||||
|
|
||||||
|
|||||||
@ -45,8 +45,9 @@ void Curl_multi_connchanged(struct Curl_multi *multi);
|
|||||||
|
|
||||||
/* Internal version of curl_multi_init() accepts size parameters for the
|
/* Internal version of curl_multi_init() accepts size parameters for the
|
||||||
socket, connection and dns hashes */
|
socket, connection and dns hashes */
|
||||||
struct Curl_multi *Curl_multi_handle(int hashsize, int chashsize,
|
struct Curl_multi *Curl_multi_handle(size_t hashsize,
|
||||||
int dnssize);
|
size_t chashsize,
|
||||||
|
size_t dnssize);
|
||||||
|
|
||||||
/* the write bits start at bit 16 for the *getsock() bitmap */
|
/* the write bits start at bit 16 for the *getsock() bitmap */
|
||||||
#define GETSOCK_WRITEBITSTART 16
|
#define GETSOCK_WRITEBITSTART 16
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user