Lines Matching full:bundle
50 conn->bundle = NULL; in conn_llist_dtor()
67 static void bundle_destroy(struct connectbundle *bundle) in bundle_destroy() argument
69 if(!bundle) in bundle_destroy()
72 Curl_llist_destroy(&bundle->conn_list, NULL); in bundle_destroy()
74 free(bundle); in bundle_destroy()
77 /* Add a connection to a bundle */
78 static void bundle_add_conn(struct connectbundle *bundle, in bundle_add_conn() argument
81 Curl_llist_insert_next(&bundle->conn_list, bundle->conn_list.tail, conn, in bundle_add_conn()
83 conn->bundle = bundle; in bundle_add_conn()
84 bundle->num_connections++; in bundle_add_conn()
87 /* Remove a connection from a bundle */
88 static int bundle_remove_conn(struct connectbundle *bundle, in bundle_remove_conn() argument
93 curr = bundle->conn_list.head; in bundle_remove_conn()
96 Curl_llist_remove(&bundle->conn_list, curr, NULL); in bundle_remove_conn()
97 bundle->num_connections--; in bundle_remove_conn()
98 conn->bundle = NULL; in bundle_remove_conn()
139 /* creates a key to find a bundle for this connection */
180 /* Look up the bundle with all the connections to the same host this
190 struct connectbundle *bundle = NULL; in Curl_conncache_find_bundle() local
195 bundle = Curl_hash_pick(&connc->hash, key, strlen(key)); in Curl_conncache_find_bundle()
198 return bundle; in Curl_conncache_find_bundle()
203 struct connectbundle *bundle) in conncache_add_bundle() argument
205 void *p = Curl_hash_add(&connc->hash, key, strlen(key), bundle); in conncache_add_bundle()
211 struct connectbundle *bundle) in conncache_remove_bundle() argument
223 if(he->ptr == bundle) { in conncache_remove_bundle()
224 /* The bundle is destroyed by the hash destructor function, in conncache_remove_bundle()
237 struct connectbundle *bundle = NULL; in Curl_conncache_add_conn() local
243 bundle = Curl_conncache_find_bundle(data, conn, data->state.conn_cache, in Curl_conncache_add_conn()
245 if(!bundle) { in Curl_conncache_add_conn()
249 result = bundle_create(&bundle); in Curl_conncache_add_conn()
255 rc = conncache_add_bundle(data->state.conn_cache, key, bundle); in Curl_conncache_add_conn()
258 bundle_destroy(bundle); in Curl_conncache_add_conn()
264 bundle_add_conn(bundle, conn); in Curl_conncache_add_conn()
288 struct connectbundle *bundle = conn->bundle; in Curl_conncache_remove_conn() local
291 /* The bundle pointer can be NULL, since this function can be called in Curl_conncache_remove_conn()
292 due to a failed connection attempt, before being added to a bundle */ in Curl_conncache_remove_conn()
293 if(bundle) { in Curl_conncache_remove_conn()
297 bundle_remove_conn(bundle, conn); in Curl_conncache_remove_conn()
298 if(bundle->num_connections == 0) in Curl_conncache_remove_conn()
299 conncache_remove_bundle(connc, bundle); in Curl_conncache_remove_conn()
300 conn->bundle = NULL; /* removed from it */ in Curl_conncache_remove_conn()
342 struct connectbundle *bundle; in Curl_conncache_foreach() local
344 bundle = he->ptr; in Curl_conncache_foreach()
347 curr = bundle->conn_list.head; in Curl_conncache_foreach()
375 struct connectbundle *bundle; in conncache_find_first_connection() local
382 bundle = he->ptr; in conncache_find_first_connection()
384 curr = bundle->conn_list.head; in conncache_find_first_connection()
427 * This function finds the connection in the connection bundle that has been
437 struct connectbundle *bundle) in Curl_conncache_extract_bundle() argument
450 curr = bundle->conn_list.head; in Curl_conncache_extract_bundle()
467 bundle_remove_conn(bundle, conn_candidate); in Curl_conncache_extract_bundle()
478 * unused for the longest time and extracts that from the bundle.
493 struct connectbundle *bundle; in Curl_conncache_extract_oldest() local
505 bundle = he->ptr; in Curl_conncache_extract_oldest()
507 curr = bundle->conn_list.head; in Curl_conncache_extract_oldest()
519 bundle_candidate = bundle; in Curl_conncache_extract_oldest()
584 fprintf(stderr, "=Bundle cache=\n");
590 struct connectbundle *bundle;
593 bundle = he->ptr;
596 curr = bundle->conn_list->head;