summaryrefslogtreecommitdiff
path: root/lib/cookie.h
diff options
context:
space:
mode:
authorLauri Kasanen <cand@gmx.com>2018-03-30 17:35:46 +0300
committerDaniel Stenberg <daniel@haxx.se>2018-04-02 10:48:53 +0200
commitc990eadd12779a22f73c834db8e1c30c6dcf0f9c (patch)
treeb3cf113dd652c3a836547ef9e5108da6733ff3d6 /lib/cookie.h
parent4073cd83b2f3bcf93f1ce7f5d567d22175bad9af (diff)
downloadcurl-c990eadd12779a22f73c834db8e1c30c6dcf0f9c.tar.gz
cookie: store cookies per top-level-domain-specific hash table
This makes libcurl handle thousands of cookies much better and speedier. Closes #2440
Diffstat (limited to 'lib/cookie.h')
-rw-r--r--lib/cookie.h4
1 files changed, 3 insertions, 1 deletions
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 */