Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
patch file
diff -urNp curl-7.65.1/lib/conncache.c curl-7.65.1/lib/conncache.c
--- curl-7.65.1/lib/conncache.c 2019-06-05 06:27:58.438954000 -0400
+++ curl-7.65.1/lib/conncache.c 2019-06-16 02:31:56.343444000 -0400
@@ -189,6 +189,11 @@ void Curl_conncache_unlock(struct Curl_e
CONN_UNLOCK(data);
}
+void Curl_conncache_lock(struct Curl_easy *data)
+{
+ CONN_LOCK(data);
+}
+
/* Returns number of connections currently held in the connection cache.
Locks/unlocks the cache itself!
*/
diff -urNp curl-7.65.1/lib/conncache.h curl-7.65.1/lib/conncache.h
--- curl-7.65.1/lib/conncache.h 2019-06-05 06:27:58.551953000 -0400
+++ curl-7.65.1/lib/conncache.h 2019-06-16 02:30:31.579141000 -0400
@@ -57,6 +57,7 @@ struct connectbundle *Curl_conncache_fin
struct conncache *connc,
const char **hostp);
void Curl_conncache_unlock(struct Curl_easy *data);
+void Curl_conncache_lock(struct Curl_easy *data);
/* returns number of connections currently held in the connection cache */
size_t Curl_conncache_size(struct Curl_easy *data);
size_t Curl_conncache_bundle_size(struct connectdata *conn);
diff -urNp curl-7.65.1/lib/url.c curl-7.65.1/lib/url.c
--- curl-7.65.1/lib/url.c 2019-06-05 06:27:58.440960000 -0400
+++ curl-7.65.1/lib/url.c 2019-06-16 02:33:30.576695000 -0400
@@ -1075,8 +1075,10 @@ ConnectionExists(struct Curl_easy *data,
continue;
if(conn_maxage(data, check, now) || extract_if_dead(check, data)) {
+ Curl_conncache_unlock(data);
/* disconnect it */
(void)Curl_disconnect(data, check, /* dead_connection */TRUE);
+ Curl_conncache_lock(data);
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.