1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-02 10:21:46 -05:00

conncache: lowercase the hash key for better match

As host names are case insensitive, the use of case sensitive hashing
caused unnecesary cache misses and therefore lost performance. This
lowercases the hash key.

Reported-by: Harry Sintonen
Fixes #7159
Closes #7161
This commit is contained in:
Daniel Stenberg 2021-06-01 08:28:29 +02:00
parent a2b1bbeef0
commit dddad339e8
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -34,6 +34,7 @@
#include "share.h"
#include "sigpipe.h"
#include "connect.h"
#include "strcase.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@ -161,6 +162,7 @@ static void hashkey(struct connectdata *conn, char *buf,
/* put the number first so that the hostname gets cut off if too long */
msnprintf(buf, len, "%ld%s", port, hostname);
Curl_strntolower(buf, buf, len);
}
/* Returns number of connections currently held in the connection cache.