Introducing a new persistent connection caching system using "bundles".
A bundle is a list of all persistent connections to the same host. The connection cache consists of a hash of bundles, with the hostname as the key. The benefits may not be obvious, but they are two: 1) Faster search for connections to reuse, since the hash lookup only finds connections to the host in question. 2) It lays out the groundworks for an upcoming patch, which will introduce multiple HTTP pipelines. This patch also removes the awkward list of "closure handles", which were needed to send QUIT commands to the FTP server when closing a connection. Now we allocate a separate closure handle and use that one to close all connections. This has been tested in a live system for a few weeks, and of course passes the test suite.
This commit is contained in:
committed by
Daniel Stenberg
parent
ca5f4e2135
commit
d021f2e8a0
@@ -46,15 +46,6 @@ CURLcode Curl_protocol_doing(struct connectdata *conn, bool *done);
|
||||
CURLcode Curl_setup_conn(struct connectdata *conn,
|
||||
bool *protocol_done);
|
||||
|
||||
/* create a connection cache */
|
||||
struct conncache *Curl_mk_connc(int type, long amount);
|
||||
/* free a connection cache */
|
||||
void Curl_rm_connc(struct conncache *c);
|
||||
/* Change number of entries of a connection cache */
|
||||
CURLcode Curl_ch_connc(struct SessionHandle *data,
|
||||
struct conncache *c,
|
||||
long newamount);
|
||||
|
||||
int Curl_protocol_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks);
|
||||
|
||||
Reference in New Issue
Block a user