diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-11-01 23:37:45 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-11-09 11:07:44 +0100 |
commit | 67c55a26d51149650e91a00b63cf5107989a57e9 (patch) | |
tree | b041c360056052d48a51585153ab4cb9c8a4e354 /lib/conncache.h | |
parent | e871ab56ed9cb0f3ab00b40e188f51cfb37b96cd (diff) | |
download | curl-67c55a26d51149650e91a00b63cf5107989a57e9.tar.gz |
share: add support for sharing the connection cache
Diffstat (limited to 'lib/conncache.h')
-rw-r--r-- | lib/conncache.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/conncache.h b/lib/conncache.h index 14be4e8e7..0d97a6cef 100644 --- a/lib/conncache.h +++ b/lib/conncache.h @@ -28,6 +28,8 @@ struct conncache { size_t num_connections; long next_connection_id; struct curltime last_cleanup; + /* handle used for closing cached connections */ + struct Curl_easy *closure_handle; }; #define BUNDLE_NO_MULTIUSE -1 @@ -41,8 +43,8 @@ struct connectbundle { struct curl_llist conn_list; /* The connectdata members of the bundle */ }; +/* returns 1 on error, 0 is fine */ int Curl_conncache_init(struct conncache *, int size); - void Curl_conncache_destroy(struct conncache *connc); /* return the correct bundle, to a host or a proxy */ @@ -55,7 +57,8 @@ CURLcode Curl_conncache_add_conn(struct conncache *connc, void Curl_conncache_remove_conn(struct conncache *connc, struct connectdata *conn); -void Curl_conncache_foreach(struct conncache *connc, +void Curl_conncache_foreach(struct Curl_easy *data, + struct conncache *connc, void *param, int (*func)(struct connectdata *conn, void *param)); @@ -63,6 +66,9 @@ void Curl_conncache_foreach(struct conncache *connc, struct connectdata * Curl_conncache_find_first_connection(struct conncache *connc); +struct connectdata * +Curl_conncache_oldest_idle(struct Curl_easy *data); +void Curl_conncache_close_all_connections(struct conncache *connc); void Curl_conncache_print(struct conncache *connc); #endif /* HEADER_CURL_CONNCACHE_H */ |