1 #ifndef HEADER_CURL_CONNCACHE_H
2 #define HEADER_CURL_CONNCACHE_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
11 * Copyright (C) 2012 - 2014, Linus Nielsen Feltzing, <linus@haxx.se>
13 * This software is licensed as described in the file COPYING, which
14 * you should have received as part of this distribution. The terms
15 * are also available at https://curl.haxx.se/docs/copyright.html.
17 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
18 * copies of the Software, and permit persons to whom the Software is
19 * furnished to do so, under the terms of the COPYING file.
21 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 * KIND, either express or implied.
24 ***************************************************************************/
27 struct curl_hash hash;
28 size_t num_connections;
29 long next_connection_id;
30 struct timeval last_cleanup;
33 #define BUNDLE_NO_MULTIUSE -1
34 #define BUNDLE_UNKNOWN 0 /* initial value */
35 #define BUNDLE_PIPELINING 1
36 #define BUNDLE_MULTIPLEX 2
38 struct connectbundle {
39 int multiuse; /* supports multi-use */
40 size_t num_connections; /* Number of connections in the bundle */
41 struct curl_llist *conn_list; /* The connectdata members of the bundle */
44 int Curl_conncache_init(struct conncache *, int size);
46 void Curl_conncache_destroy(struct conncache *connc);
48 /* return the correct bundle, to a host or a proxy */
49 struct connectbundle *Curl_conncache_find_bundle(struct connectdata *conn,
50 struct conncache *connc);
52 CURLcode Curl_conncache_add_conn(struct conncache *connc,
53 struct connectdata *conn);
55 void Curl_conncache_remove_conn(struct conncache *connc,
56 struct connectdata *conn);
58 void Curl_conncache_foreach(struct conncache *connc,
60 int (*func)(struct connectdata *conn,
64 Curl_conncache_find_first_connection(struct conncache *connc);
66 void Curl_conncache_print(struct conncache *connc);
68 #endif /* HEADER_CURL_CONNCACHE_H */