From c990eadd12779a22f73c834db8e1c30c6dcf0f9c Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 30 Mar 2018 17:35:46 +0300 Subject: cookie: store cookies per top-level-domain-specific hash table This makes libcurl handle thousands of cookies much better and speedier. Closes #2440 --- lib/cookie.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/cookie.h') diff --git a/lib/cookie.h b/lib/cookie.h index 5342d528c..299eb52e7 100644 --- a/lib/cookie.h +++ b/lib/cookie.h @@ -45,9 +45,11 @@ struct Cookie { bool httponly; /* true if the httponly directive is present */ }; +#define COOKIE_HASH_SIZE 256 + struct CookieInfo { /* linked list of cookies we know of */ - struct Cookie *cookies; + struct Cookie *cookies[COOKIE_HASH_SIZE]; char *filename; /* file we read from/write to */ bool running; /* state info, for cookie adding information */ -- cgit v1.2.3