Lines Matching refs:conn
85 struct connectdata *conn,
88 struct connectdata *conn,
92 struct connectdata *conn,
95 struct connectdata *conn);
98 struct connectdata *conn);
125 struct connectdata *conn) in cpool_bundle_add() argument
127 DEBUGASSERT(!Curl_node_llist(&conn->cpool_node)); in cpool_bundle_add()
128 Curl_llist_append(&bundle->conns, conn, &conn->cpool_node); in cpool_bundle_add()
129 conn->bits.in_cpool = TRUE; in cpool_bundle_add()
134 struct connectdata *conn) in cpool_bundle_remove() argument
137 DEBUGASSERT(Curl_node_llist(&conn->cpool_node) == &bundle->conns); in cpool_bundle_remove()
138 Curl_node_remove(&conn->cpool_node); in cpool_bundle_remove()
139 conn->bits.in_cpool = FALSE; in cpool_bundle_remove()
246 struct connectdata *conn) in cpool_find_bundle() argument
249 conn->destination, conn->destination_len); in cpool_find_bundle()
253 cpool_add_bundle(struct cpool *cpool, struct connectdata *conn) in cpool_add_bundle() argument
257 bundle = cpool_bundle_create(conn->destination, conn->destination_len); in cpool_add_bundle()
282 struct connectdata *conn) in Curl_cpool_check_limits() argument
303 bundle = cpool_find_bundle(cpool, conn); in Curl_cpool_check_limits()
319 bundle = cpool_find_bundle(cpool, conn); in Curl_cpool_check_limits()
351 struct connectdata *conn) in Curl_cpool_add_conn() argument
356 DEBUGASSERT(conn); in Curl_cpool_add_conn()
363 bundle = cpool_find_bundle(cpool, conn); in Curl_cpool_add_conn()
365 bundle = cpool_add_bundle(cpool, conn); in Curl_cpool_add_conn()
372 cpool_bundle_add(bundle, conn); in Curl_cpool_add_conn()
373 conn->connection_id = cpool->next_connection_id++; in Curl_cpool_add_conn()
377 conn->connection_id, cpool->num_conn)); in Curl_cpool_add_conn()
385 struct connectdata *conn) in cpool_remove_conn() argument
387 struct Curl_llist *list = Curl_node_llist(&conn->cpool_node); in cpool_remove_conn()
391 struct cpool_bundle *bundle = cpool_find_bundle(cpool, conn); in cpool_remove_conn()
393 cpool_bundle_remove(bundle, conn); in cpool_remove_conn()
396 conn->bits.in_cpool = FALSE; in cpool_remove_conn()
422 struct connectdata *conn, void *param)) in cpool_foreach() argument
442 struct connectdata *conn = Curl_node_elem(curr); in cpool_foreach() local
445 if(1 == func(data, conn, param)) { in cpool_foreach()
479 struct connectdata *conn) in Curl_cpool_conn_now_idle() argument
487 conn->lastused = Curl_now(); /* it was used up until now */ in Curl_cpool_conn_now_idle()
497 kept = (oldest_idle != conn); in Curl_cpool_conn_now_idle()
521 struct connectdata *conn; in cpool_bundle_get_oldest_idle() local
526 conn = Curl_node_elem(curr); in cpool_bundle_get_oldest_idle()
528 if(!CONN_INUSE(conn)) { in cpool_bundle_get_oldest_idle()
530 score = Curl_timediff(now, conn->lastused); in cpool_bundle_get_oldest_idle()
534 oldest_idle = conn; in cpool_bundle_get_oldest_idle()
558 struct connectdata *conn; in cpool_get_oldest_idle() local
563 conn = Curl_node_elem(curr); in cpool_get_oldest_idle()
564 if(CONN_INUSE(conn) || conn->bits.close || conn->connect_only) in cpool_get_oldest_idle()
567 score = Curl_timediff(now, conn->lastused); in cpool_get_oldest_idle()
570 oldest_idle = conn; in cpool_get_oldest_idle()
597 struct connectdata *conn = Curl_node_elem(curr); in Curl_cpool_find() local
601 if(conn_cb(conn, userdata)) { in Curl_cpool_find()
618 struct connectdata *conn; in cpool_shutdown_discard_all() local
625 conn = Curl_node_elem(e); in cpool_shutdown_discard_all()
628 conn->connection_id)); in cpool_shutdown_discard_all()
629 cpool_close_and_destroy(cpool, conn, NULL, FALSE); in cpool_shutdown_discard_all()
636 struct connectdata *conn; in cpool_close_and_destroy_all() local
644 conn = cpool_get_live_conn(cpool); in cpool_close_and_destroy_all()
645 while(conn) { in cpool_close_and_destroy_all()
646 cpool_remove_conn(cpool, conn); in cpool_close_and_destroy_all()
648 connclose(conn, "kill all"); in cpool_close_and_destroy_all()
649 cpool_discard_conn(cpool, cpool->idata, conn, FALSE); in cpool_close_and_destroy_all()
651 conn = cpool_get_live_conn(cpool); in cpool_close_and_destroy_all()
680 struct connectdata *conn; in cpool_shutdown_destroy_oldest() local
685 conn = Curl_node_elem(e); in cpool_shutdown_destroy_oldest()
689 cpool_close_and_destroy(cpool, conn, NULL, FALSE); in cpool_shutdown_destroy_oldest()
696 struct connectdata *conn, in cpool_discard_conn() argument
703 DEBUGASSERT(!conn->bits.in_cpool); in cpool_discard_conn()
709 if(CONN_INUSE(conn) && !aborted) { in cpool_discard_conn()
711 " still in use by %zu transfers", conn->connection_id, in cpool_discard_conn()
712 CONN_INUSE(conn))); in cpool_discard_conn()
718 if(conn->connect_only) in cpool_discard_conn()
720 conn->bits.aborted = aborted; in cpool_discard_conn()
731 Curl_attach_connection(data, conn); in cpool_discard_conn()
732 cpool_run_conn_shutdown(data, conn, &done); in cpool_discard_conn()
734 conn->connection_id, done)); in cpool_discard_conn()
739 cpool_close_and_destroy(cpool, conn, data, FALSE); in cpool_discard_conn()
758 memset(&conn->shutdown_poll, 0, sizeof(conn->shutdown_poll)); in cpool_discard_conn()
759 if(cpool_update_shutdown_ev(data->multi, cpool->idata, conn)) { in cpool_discard_conn()
762 conn->connection_id)); in cpool_discard_conn()
763 cpool_close_and_destroy(cpool, conn, data, FALSE); in cpool_discard_conn()
768 Curl_llist_append(&cpool->shutdowns, conn, &conn->cpool_node); in cpool_discard_conn()
770 " to shutdown list of length %zu", conn->connection_id, in cpool_discard_conn()
775 struct connectdata *conn, in Curl_cpool_disconnect() argument
782 DEBUGASSERT(data && !data->conn); in Curl_cpool_disconnect()
788 if(CONN_INUSE(conn) && !aborted) { in Curl_cpool_disconnect()
790 DEBUGF(infof(data, "Curl_disconnect when inuse: %zu", CONN_INUSE(conn))); in Curl_cpool_disconnect()
800 if(conn->bits.in_cpool) { in Curl_cpool_disconnect()
801 cpool_remove_conn(cpool, conn); in Curl_cpool_disconnect()
802 DEBUGASSERT(!conn->bits.in_cpool); in Curl_cpool_disconnect()
806 aborted = cpool->disconnect_cb(data, conn, aborted); in Curl_cpool_disconnect()
811 aborted ? "closing" : "shutting down", conn->connection_id); in Curl_cpool_disconnect()
812 cpool_discard_conn(&data->multi->cpool, data, conn, aborted); in Curl_cpool_disconnect()
816 infof(data, "closing connection #%" FMT_OFF_T, conn->connection_id); in Curl_cpool_disconnect()
817 cpool_close_and_destroy(NULL, conn, data, !aborted); in Curl_cpool_disconnect()
825 struct connectdata *conn) in cpool_run_conn_shutdown_handler() argument
827 if(!conn->bits.shutdown_handler) { in cpool_run_conn_shutdown_handler()
828 if(conn->dns_entry) in cpool_run_conn_shutdown_handler()
829 Curl_resolv_unlink(data, &conn->dns_entry); in cpool_run_conn_shutdown_handler()
832 Curl_http_auth_cleanup_ntlm(conn); in cpool_run_conn_shutdown_handler()
835 Curl_http_auth_cleanup_negotiate(conn); in cpool_run_conn_shutdown_handler()
837 if(conn->handler && conn->handler->disconnect) { in cpool_run_conn_shutdown_handler()
841 conn->connection_id, conn->bits.aborted)); in cpool_run_conn_shutdown_handler()
843 conn->handler->disconnect(data, conn, conn->bits.aborted); in cpool_run_conn_shutdown_handler()
849 conn->bits.shutdown_handler = TRUE; in cpool_run_conn_shutdown_handler()
854 struct connectdata *conn, in cpool_run_conn_shutdown() argument
861 DEBUGASSERT(data->conn == conn); in cpool_run_conn_shutdown()
863 cpool_run_conn_shutdown_handler(data, conn); in cpool_run_conn_shutdown()
865 if(conn->bits.shutdown_filters) { in cpool_run_conn_shutdown()
870 if(!conn->connect_only && Curl_conn_is_connected(conn, FIRSTSOCKET)) in cpool_run_conn_shutdown()
877 if(!conn->connect_only && Curl_conn_is_connected(conn, SECONDARYSOCKET)) in cpool_run_conn_shutdown()
887 conn->bits.shutdown_filters = TRUE; in cpool_run_conn_shutdown()
898 struct connectdata *conn; in cpool_add_pollfds() local
902 conn = Curl_node_elem(e); in cpool_add_pollfds()
904 Curl_attach_connection(cpool->idata, conn); in cpool_add_pollfds()
938 struct connectdata *conn; in Curl_cpool_add_waitfds() local
942 conn = Curl_node_elem(e); in Curl_cpool_add_waitfds()
944 Curl_attach_connection(cpool->idata, conn); in Curl_cpool_add_waitfds()
963 struct connectdata *conn; in cpool_perform() local
977 conn = Curl_node_elem(e); in cpool_perform()
978 Curl_attach_connection(data, conn); in cpool_perform()
979 cpool_run_conn_shutdown(data, conn, &done); in cpool_perform()
981 conn->connection_id, done)); in cpool_perform()
985 cpool_close_and_destroy(cpool, conn, NULL, FALSE); in cpool_perform()
993 ms = Curl_conn_shutdown_timeleft(conn, nowp); in cpool_perform()
1017 struct connectdata *conn, in cpool_close_and_destroy() argument
1024 DEBUGASSERT(conn); in cpool_close_and_destroy()
1026 DEBUGASSERT(!conn->bits.in_cpool); in cpool_close_and_destroy()
1033 DEBUGASSERT(data && !data->conn); in cpool_close_and_destroy()
1035 Curl_attach_connection(data, conn); in cpool_close_and_destroy()
1037 cpool_run_conn_shutdown_handler(data, conn); in cpool_close_and_destroy()
1041 cpool_run_conn_shutdown(data, conn, &done); in cpool_close_and_destroy()
1046 conn->connection_id)); in cpool_close_and_destroy()
1049 conn->connection_id)); in cpool_close_and_destroy()
1054 Curl_conn_free(data, conn); in cpool_close_and_destroy()
1060 struct connectdata *conn) in cpool_update_shutdown_ev() argument
1070 Curl_attach_connection(data, conn); in cpool_update_shutdown_ev()
1074 mresult = Curl_multi_pollset_ev(multi, data, &ps, &conn->shutdown_poll); in cpool_update_shutdown_ev()
1077 memcpy(&conn->shutdown_poll, &ps, sizeof(ps)); in cpool_update_shutdown_ev()
1087 struct connectdata *conn; in Curl_cpool_multi_socket() local
1095 conn = Curl_node_elem(e); in Curl_cpool_multi_socket()
1096 if(s == conn->sock[FIRSTSOCKET] || s == conn->sock[SECONDARYSOCKET]) { in Curl_cpool_multi_socket()
1097 Curl_attach_connection(data, conn); in Curl_cpool_multi_socket()
1098 cpool_run_conn_shutdown(data, conn, &done); in Curl_cpool_multi_socket()
1100 conn->connection_id, done)); in Curl_cpool_multi_socket()
1102 if(done || cpool_update_shutdown_ev(multi, data, conn)) { in Curl_cpool_multi_socket()
1104 cpool_close_and_destroy(cpool, conn, NULL, FALSE); in Curl_cpool_multi_socket()
1137 struct connectdata *conn; in cpool_shutdown_all() local
1147 for(conn = cpool_get_live_conn(cpool); conn; in cpool_shutdown_all()
1148 conn = cpool_get_live_conn(cpool)) { in cpool_shutdown_all()
1151 " to shutdown queue", conn->connection_id)); in cpool_shutdown_all()
1152 cpool_remove_conn(cpool, conn); in cpool_shutdown_all()
1153 cpool_discard_conn(cpool, data, conn, FALSE); in cpool_shutdown_all()
1191 struct connectdata *conn, void *param) in cpool_reap_dead_cb() argument
1194 if(Curl_conn_seems_dead(conn, data, &rctx->now)) { in cpool_reap_dead_cb()
1196 Curl_cpool_disconnect(data, conn, FALSE); in cpool_reap_dead_cb()
1231 struct connectdata *conn, in conn_upkeep() argument
1236 Curl_conn_upkeep(data, conn, now); in conn_upkeep()
1256 struct connectdata *conn; member
1260 struct connectdata *conn, void *param) in cpool_find_conn() argument
1264 if(conn->connection_id == fctx->id) { in cpool_find_conn()
1265 fctx->conn = conn; in cpool_find_conn()
1280 fctx.conn = NULL; in Curl_cpool_get_conn()
1284 return fctx.conn; in Curl_cpool_get_conn()
1294 struct connectdata *conn, void *param) in cpool_do_conn() argument
1298 if(conn->connection_id == dctx->id) { in cpool_do_conn()
1299 dctx->cb(conn, data, dctx->cbdata); in cpool_do_conn()
1322 struct connectdata *conn, in Curl_cpool_do_locked() argument
1328 cb(conn, data, cbdata); in Curl_cpool_do_locked()
1332 cb(conn, data, cbdata); in Curl_cpool_do_locked()
1353 struct connectdata *conn;
1360 conn = Curl_node_elem(curr);
1362 fprintf(stderr, " [%p %d]", (void *)conn, conn->refcount);