Lines Matching refs:connc
113 int Curl_conncache_init(struct conncache *connc, int size) in Curl_conncache_init() argument
118 connc->closure_handle = curl_easy_init(); in Curl_conncache_init()
119 if(!connc->closure_handle) in Curl_conncache_init()
122 rc = Curl_hash_init(&connc->hash, size, Curl_hash_str, in Curl_conncache_init()
125 Curl_close(&connc->closure_handle); in Curl_conncache_init()
127 connc->closure_handle->state.conn_cache = connc; in Curl_conncache_init()
132 void Curl_conncache_destroy(struct conncache *connc) in Curl_conncache_destroy() argument
134 if(connc) in Curl_conncache_destroy()
135 Curl_hash_destroy(&connc->hash); in Curl_conncache_destroy()
183 struct conncache *connc, in Curl_conncache_find_bundle() argument
188 if(connc) { in Curl_conncache_find_bundle()
191 bundle = Curl_hash_pick(&connc->hash, key, strlen(key)); in Curl_conncache_find_bundle()
197 static bool conncache_add_bundle(struct conncache *connc, in conncache_add_bundle() argument
201 void *p = Curl_hash_add(&connc->hash, key, strlen(key), bundle); in conncache_add_bundle()
206 static void conncache_remove_bundle(struct conncache *connc, in conncache_remove_bundle() argument
212 if(!connc) in conncache_remove_bundle()
215 Curl_hash_start_iterate(&connc->hash, &iter); in conncache_remove_bundle()
222 Curl_hash_delete(&connc->hash, he->key, he->key_len); in conncache_remove_bundle()
230 CURLcode Curl_conncache_add_conn(struct conncache *connc, in Curl_conncache_add_conn() argument
259 conn->connection_id = connc->next_connection_id++; in Curl_conncache_add_conn()
260 connc->num_conn++; in Curl_conncache_add_conn()
264 conn->connection_id, connc->num_conn)); in Curl_conncache_add_conn()
283 struct conncache *connc = data->state.conn_cache; in Curl_conncache_remove_conn() local
293 conncache_remove_bundle(connc, bundle); in Curl_conncache_remove_conn()
295 if(connc) { in Curl_conncache_remove_conn()
296 connc->num_conn--; in Curl_conncache_remove_conn()
298 connc->num_conn)); in Curl_conncache_remove_conn()
319 struct conncache *connc, in Curl_conncache_foreach() argument
327 if(!connc) in Curl_conncache_foreach()
331 Curl_hash_start_iterate(&connc->hash, &iter); in Curl_conncache_foreach()
364 conncache_find_first_connection(struct conncache *connc) in conncache_find_first_connection() argument
370 Curl_hash_start_iterate(&connc->hash, &iter); in conncache_find_first_connection()
479 struct conncache *connc = data->state.conn_cache; in Curl_conncache_extract_oldest() local
493 Curl_hash_start_iterate(&connc->hash, &iter); in Curl_conncache_extract_oldest()
524 connc->num_conn--; in Curl_conncache_extract_oldest()
526 connc->num_conn)); in Curl_conncache_extract_oldest()
534 void Curl_conncache_close_all_connections(struct conncache *connc) in Curl_conncache_close_all_connections() argument
538 if(!connc->closure_handle) in Curl_conncache_close_all_connections()
540 connc->closure_handle->state.buffer = buffer; in Curl_conncache_close_all_connections()
541 connc->closure_handle->set.buffer_size = READBUFFER_MIN; in Curl_conncache_close_all_connections()
543 conn = conncache_find_first_connection(connc); in Curl_conncache_close_all_connections()
546 conn->data = connc->closure_handle; in Curl_conncache_close_all_connections()
552 (void)Curl_disconnect(connc->closure_handle, conn, FALSE); in Curl_conncache_close_all_connections()
555 conn = conncache_find_first_connection(connc); in Curl_conncache_close_all_connections()
558 connc->closure_handle->state.buffer = NULL; in Curl_conncache_close_all_connections()
559 if(connc->closure_handle) { in Curl_conncache_close_all_connections()
561 sigpipe_ignore(connc->closure_handle, &pipe_st); in Curl_conncache_close_all_connections()
563 Curl_hostcache_clean(connc->closure_handle, in Curl_conncache_close_all_connections()
564 connc->closure_handle->dns.hostcache); in Curl_conncache_close_all_connections()
565 Curl_close(&connc->closure_handle); in Curl_conncache_close_all_connections()
572 void Curl_conncache_print(struct conncache *connc)
578 if(!connc)
583 Curl_hash_start_iterate(connc->hash, &iter);