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