Lines Matching full:bundle
62 static void bundle_destroy(struct connectbundle *bundle) in bundle_destroy() argument
64 free(bundle); in bundle_destroy()
67 /* Add a connection to a bundle */
68 static void bundle_add_conn(struct connectbundle *bundle, in bundle_add_conn() argument
71 Curl_llist_insert_next(&bundle->conn_list, bundle->conn_list.tail, conn, in bundle_add_conn()
73 conn->bundle = bundle; in bundle_add_conn()
74 bundle->num_connections++; in bundle_add_conn()
77 /* Remove a connection from a bundle */
78 static int bundle_remove_conn(struct connectbundle *bundle, in bundle_remove_conn() argument
83 curr = bundle->conn_list.head; in bundle_remove_conn()
86 Curl_llist_remove(&bundle->conn_list, curr, NULL); in bundle_remove_conn()
87 bundle->num_connections--; in bundle_remove_conn()
88 conn->bundle = NULL; in bundle_remove_conn()
125 /* creates a key to find a bundle for this connection */
164 /* Look up the bundle with all the connections to the same host this
173 struct connectbundle *bundle = NULL; in Curl_conncache_find_bundle() local
178 bundle = Curl_hash_pick(&connc->hash, key, strlen(key)); in Curl_conncache_find_bundle()
181 return bundle; in Curl_conncache_find_bundle()
186 struct connectbundle *bundle) in conncache_add_bundle() argument
188 return Curl_hash_add(&connc->hash, key, strlen(key), bundle); in conncache_add_bundle()
192 struct connectbundle *bundle) in conncache_remove_bundle() argument
204 if(he->ptr == bundle) { in conncache_remove_bundle()
205 /* The bundle is destroyed by the hash destructor function, in conncache_remove_bundle()
218 struct connectbundle *bundle = NULL; in Curl_conncache_add_conn() local
224 bundle = Curl_conncache_find_bundle(data, conn, data->state.conn_cache); in Curl_conncache_add_conn()
225 if(!bundle) { in Curl_conncache_add_conn()
228 result = bundle_create(&bundle); in Curl_conncache_add_conn()
235 if(!conncache_add_bundle(data->state.conn_cache, key, bundle)) { in Curl_conncache_add_conn()
236 bundle_destroy(bundle); in Curl_conncache_add_conn()
242 bundle_add_conn(bundle, conn); in Curl_conncache_add_conn()
266 struct connectbundle *bundle = conn->bundle; in Curl_conncache_remove_conn() local
269 /* The bundle pointer can be NULL, since this function can be called in Curl_conncache_remove_conn()
270 due to a failed connection attempt, before being added to a bundle */ in Curl_conncache_remove_conn()
271 if(bundle) { in Curl_conncache_remove_conn()
275 bundle_remove_conn(bundle, conn); in Curl_conncache_remove_conn()
276 if(bundle->num_connections == 0) in Curl_conncache_remove_conn()
277 conncache_remove_bundle(connc, bundle); in Curl_conncache_remove_conn()
278 conn->bundle = NULL; /* removed from it */ in Curl_conncache_remove_conn()
320 struct connectbundle *bundle; in Curl_conncache_foreach() local
322 bundle = he->ptr; in Curl_conncache_foreach()
325 curr = bundle->conn_list.head; in Curl_conncache_foreach()
353 struct connectbundle *bundle; in conncache_find_first_connection() local
360 bundle = he->ptr; in conncache_find_first_connection()
362 curr = bundle->conn_list.head; in conncache_find_first_connection()
410 * This function finds the connection in the connection bundle that has been
420 struct connectbundle *bundle) in Curl_conncache_extract_bundle() argument
433 curr = bundle->conn_list.head; in Curl_conncache_extract_bundle()
450 bundle_remove_conn(bundle, conn_candidate); in Curl_conncache_extract_bundle()
461 * unused for the longest time and extracts that from the bundle.
476 struct connectbundle *bundle; in Curl_conncache_extract_oldest() local
488 bundle = he->ptr; in Curl_conncache_extract_oldest()
490 curr = bundle->conn_list.head; in Curl_conncache_extract_oldest()
502 bundle_candidate = bundle; in Curl_conncache_extract_oldest()
564 fprintf(stderr, "=Bundle cache=\n");
570 struct connectbundle *bundle;
573 bundle = he->ptr;
576 curr = bundle->conn_list->head;