Lines Matching refs:bundle
107 struct cpool_bundle *bundle; in cpool_bundle_create() local
108 bundle = calloc(1, sizeof(*bundle) + dest_len); in cpool_bundle_create()
109 if(!bundle) in cpool_bundle_create()
111 Curl_llist_init(&bundle->conns, NULL); in cpool_bundle_create()
112 bundle->dest_len = dest_len; in cpool_bundle_create()
113 memcpy(bundle->dest, dest, dest_len); in cpool_bundle_create()
114 return bundle; in cpool_bundle_create()
117 static void cpool_bundle_destroy(struct cpool_bundle *bundle) in cpool_bundle_destroy() argument
119 DEBUGASSERT(!Curl_llist_count(&bundle->conns)); in cpool_bundle_destroy()
120 free(bundle); in cpool_bundle_destroy()
124 static void cpool_bundle_add(struct cpool_bundle *bundle, in cpool_bundle_add() argument
128 Curl_llist_append(&bundle->conns, conn, &conn->cpool_node); in cpool_bundle_add()
133 static void cpool_bundle_remove(struct cpool_bundle *bundle, in cpool_bundle_remove() argument
136 (void)bundle; in cpool_bundle_remove()
137 DEBUGASSERT(Curl_node_llist(&conn->cpool_node) == &bundle->conns); in cpool_bundle_remove()
255 struct cpool_bundle *bundle; in cpool_add_bundle() local
257 bundle = cpool_bundle_create(conn->destination, conn->destination_len); in cpool_add_bundle()
258 if(!bundle) in cpool_add_bundle()
262 bundle->dest, bundle->dest_len, bundle)) { in cpool_add_bundle()
263 cpool_bundle_destroy(bundle); in cpool_add_bundle()
266 return bundle; in cpool_add_bundle()
270 struct cpool_bundle *bundle) in cpool_remove_bundle() argument
275 Curl_hash_delete(&cpool->dest2bundle, bundle->dest, bundle->dest_len); in cpool_remove_bundle()
279 cpool_bundle_get_oldest_idle(struct cpool_bundle *bundle);
285 struct cpool_bundle *bundle; in Curl_cpool_check_limits() local
303 bundle = cpool_find_bundle(cpool, conn); in Curl_cpool_check_limits()
304 while(bundle && (Curl_llist_count(&bundle->conns) >= dest_limit)) { in Curl_cpool_check_limits()
308 oldest_idle = cpool_bundle_get_oldest_idle(bundle); in Curl_cpool_check_limits()
315 Curl_llist_count(&bundle->conns), dest_limit)); in Curl_cpool_check_limits()
319 bundle = cpool_find_bundle(cpool, conn); in Curl_cpool_check_limits()
321 if(bundle && (Curl_llist_count(&bundle->conns) >= dest_limit)) { in Curl_cpool_check_limits()
354 struct cpool_bundle *bundle = NULL; in Curl_cpool_add_conn() local
363 bundle = cpool_find_bundle(cpool, conn); in Curl_cpool_add_conn()
364 if(!bundle) { in Curl_cpool_add_conn()
365 bundle = cpool_add_bundle(cpool, conn); in Curl_cpool_add_conn()
366 if(!bundle) { in Curl_cpool_add_conn()
372 cpool_bundle_add(bundle, conn); in Curl_cpool_add_conn()
391 struct cpool_bundle *bundle = cpool_find_bundle(cpool, conn); in cpool_remove_conn() local
392 if(bundle && (list == &bundle->conns)) { in cpool_remove_conn()
393 cpool_bundle_remove(bundle, conn); in cpool_remove_conn()
394 if(!Curl_llist_count(&bundle->conns)) in cpool_remove_conn()
395 cpool_remove_bundle(cpool, bundle); in cpool_remove_conn()
435 struct cpool_bundle *bundle = he->ptr; in cpool_foreach() local
438 curr = Curl_llist_head(&bundle->conns); in cpool_foreach()
458 struct cpool_bundle *bundle; in cpool_get_live_conn() local
464 bundle = he->ptr; in cpool_get_live_conn()
465 conn_node = Curl_llist_head(&bundle->conns); in cpool_get_live_conn()
514 cpool_bundle_get_oldest_idle(struct cpool_bundle *bundle) in cpool_bundle_get_oldest_idle() argument
524 curr = Curl_llist_head(&bundle->conns); in cpool_bundle_get_oldest_idle()
548 struct cpool_bundle *bundle; in cpool_get_oldest_idle() local
559 bundle = he->ptr; in cpool_get_oldest_idle()
561 for(curr = Curl_llist_head(&bundle->conns); curr; in cpool_get_oldest_idle()
584 struct cpool_bundle *bundle; in Curl_cpool_find() local
593 bundle = Curl_hash_pick(&cpool->dest2bundle, (void *)destination, dest_len); in Curl_cpool_find()
594 if(bundle) { in Curl_cpool_find()
595 struct Curl_llist_node *curr = Curl_llist_head(&bundle->conns); in Curl_cpool_find()
1352 struct cpool_bundle *bundle;
1355 bundle = he->ptr;
1358 curr = Curl_llist_head(bundle->conns);