Lines Matching refs:cf
362 struct Curl_cfilter *cf; /* current sub-cfilter connecting */ member
439 if(baller && baller->cf) { in baller_close()
440 Curl_conn_cf_discard_chain(&baller->cf, data); in baller_close()
471 static void baller_initiate(struct Curl_cfilter *cf, in baller_initiate() argument
475 struct cf_he_ctx *ctx = cf->ctx; in baller_initiate()
476 struct Curl_cfilter *cf_prev = baller->cf; in baller_initiate()
485 result = baller->cf_create(&baller->cf, data, cf->conn, baller->addr, in baller_initiate()
491 for(wcf = baller->cf; wcf; wcf = wcf->next) { in baller_initiate()
492 wcf->conn = cf->conn; in baller_initiate()
493 wcf->sockindex = cf->sockindex; in baller_initiate()
502 CURL_TRC_CF(data, cf, "%s failed", baller->name); in baller_initiate()
516 static CURLcode baller_start(struct Curl_cfilter *cf, in baller_start() argument
529 baller_initiate(cf, data, baller); in baller_start()
543 static CURLcode baller_start_next(struct Curl_cfilter *cf, in baller_start_next() argument
548 if(cf->sockindex == FIRSTSOCKET) { in baller_start_next()
556 baller_start(cf, data, baller, timeoutms); in baller_start_next()
568 static CURLcode baller_connect(struct Curl_cfilter *cf, in baller_connect() argument
574 (void)cf; in baller_connect()
578 baller->result = Curl_conn_cf_connect(baller->cf, data, 0, connected); in baller_connect()
603 static CURLcode is_connected(struct Curl_cfilter *cf, in is_connected() argument
607 struct cf_he_ctx *ctx = cf->ctx; in is_connected()
608 struct connectdata *conn = cf->conn; in is_connected()
635 baller->result = baller_connect(cf, data, baller, &now, connected); in is_connected()
636 CURL_TRC_CF(data, cf, "%s connect -> %d, connected=%d", in is_connected()
656 baller_start_next(cf, data, baller, Curl_timeleft(data, &now, TRUE)); in is_connected()
658 CURL_TRC_CF(data, cf, "%s done", baller->name); in is_connected()
662 CURL_TRC_CF(data, cf, "%s trying next", baller->name); in is_connected()
695 baller_start(cf, data, baller, Curl_timeleft(data, &now, TRUE)); in is_connected()
697 CURL_TRC_CF(data, cf, "%s done", baller->name); in is_connected()
700 CURL_TRC_CF(data, cf, "%s starting (timeout=%" FMT_TIMEDIFF_T "ms)", in is_connected()
718 CURL_TRC_CF(data, cf, "all eyeballers failed"); in is_connected()
724 CURL_TRC_CF(data, cf, "%s assess started=%d, result=%d", in is_connected()
765 static CURLcode start_connect(struct Curl_cfilter *cf, in start_connect() argument
769 struct cf_he_ctx *ctx = cf->ctx; in start_connect()
770 struct connectdata *conn = cf->conn; in start_connect()
838 CURL_TRC_CF(data, cf, "created %s (timeout %" FMT_TIMEDIFF_T "ms)", in start_connect()
849 CURL_TRC_CF(data, cf, "created %s (timeout %" FMT_TIMEDIFF_T "ms)", in start_connect()
858 static void cf_he_ctx_clear(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_he_ctx_clear() argument
860 struct cf_he_ctx *ctx = cf->ctx; in cf_he_ctx_clear()
873 static CURLcode cf_he_shutdown(struct Curl_cfilter *cf, in cf_he_shutdown() argument
876 struct cf_he_ctx *ctx = cf->ctx; in cf_he_shutdown()
881 if(cf->connected) { in cf_he_shutdown()
891 if(!baller || !baller->cf || baller->shutdown) in cf_he_shutdown()
893 baller->result = baller->cf->cft->do_shutdown(baller->cf, data, &bdone); in cf_he_shutdown()
909 CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", result, *done); in cf_he_shutdown()
913 static void cf_he_adjust_pollset(struct Curl_cfilter *cf, in cf_he_adjust_pollset() argument
917 struct cf_he_ctx *ctx = cf->ctx; in cf_he_adjust_pollset()
920 if(!cf->connected) { in cf_he_adjust_pollset()
923 if(!baller || !baller->cf) in cf_he_adjust_pollset()
925 Curl_conn_cf_adjust_pollset(baller->cf, data, ps); in cf_he_adjust_pollset()
927 CURL_TRC_CF(data, cf, "adjust_pollset -> %d socks", ps->num); in cf_he_adjust_pollset()
931 static CURLcode cf_he_connect(struct Curl_cfilter *cf, in cf_he_connect() argument
935 struct cf_he_ctx *ctx = cf->ctx; in cf_he_connect()
938 if(cf->connected) { in cf_he_connect()
949 DEBUGASSERT(CURL_SOCKET_BAD == Curl_conn_cf_get_socket(cf, data)); in cf_he_connect()
950 DEBUGASSERT(!cf->connected); in cf_he_connect()
951 result = start_connect(cf, data, ctx->remotehost); in cf_he_connect()
957 result = is_connected(cf, data, done); in cf_he_connect()
960 DEBUGASSERT(ctx->winner->cf); in cf_he_connect()
961 DEBUGASSERT(ctx->winner->cf->connected); in cf_he_connect()
965 cf->connected = TRUE; in cf_he_connect()
966 cf->next = ctx->winner->cf; in cf_he_connect()
967 ctx->winner->cf = NULL; in cf_he_connect()
968 cf_he_ctx_clear(cf, data); in cf_he_connect()
970 if(cf->conn->handler->protocol & PROTO_FAMILY_SSH) in cf_he_connect()
972 if(Curl_trc_cf_is_verbose(cf, data)) { in cf_he_connect()
975 if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) { in cf_he_connect()
978 cf->next->cft->get_host(cf->next, data, &host, &disphost, &port); in cf_he_connect()
979 CURL_TRC_CF(data, cf, "Connected to %s (%s) port %u", in cf_he_connect()
993 static void cf_he_close(struct Curl_cfilter *cf, in cf_he_close() argument
996 struct cf_he_ctx *ctx = cf->ctx; in cf_he_close()
998 CURL_TRC_CF(data, cf, "close"); in cf_he_close()
999 cf_he_ctx_clear(cf, data); in cf_he_close()
1000 cf->connected = FALSE; in cf_he_close()
1003 if(cf->next) { in cf_he_close()
1004 cf->next->cft->do_close(cf->next, data); in cf_he_close()
1005 Curl_conn_cf_discard_chain(&cf->next, data); in cf_he_close()
1009 static bool cf_he_data_pending(struct Curl_cfilter *cf, in cf_he_data_pending() argument
1012 struct cf_he_ctx *ctx = cf->ctx; in cf_he_data_pending()
1015 if(cf->connected) in cf_he_data_pending()
1016 return cf->next->cft->has_data_pending(cf->next, data); in cf_he_data_pending()
1020 if(!baller || !baller->cf) in cf_he_data_pending()
1022 if(baller->cf->cft->has_data_pending(baller->cf, data)) in cf_he_data_pending()
1028 static struct curltime get_max_baller_time(struct Curl_cfilter *cf, in get_max_baller_time() argument
1032 struct cf_he_ctx *ctx = cf->ctx; in get_max_baller_time()
1041 if(baller && baller->cf && in get_max_baller_time()
1042 !baller->cf->cft->query(baller->cf, data, query, NULL, &t)) { in get_max_baller_time()
1050 static CURLcode cf_he_query(struct Curl_cfilter *cf, in cf_he_query() argument
1054 struct cf_he_ctx *ctx = cf->ctx; in cf_he_query()
1056 if(!cf->connected) { in cf_he_query()
1066 if(baller && baller->cf && in cf_he_query()
1067 !baller->cf->cft->query(baller->cf, data, query, in cf_he_query()
1074 CURL_TRC_CF(data, cf, "query connect reply: %dms", *pres1); in cf_he_query()
1079 *when = get_max_baller_time(cf, data, CF_QUERY_TIMER_CONNECT); in cf_he_query()
1084 *when = get_max_baller_time(cf, data, CF_QUERY_TIMER_APPCONNECT); in cf_he_query()
1092 return cf->next ? in cf_he_query()
1093 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in cf_he_query()
1097 static void cf_he_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_he_destroy() argument
1099 struct cf_he_ctx *ctx = cf->ctx; in cf_he_destroy()
1101 CURL_TRC_CF(data, cf, "destroy"); in cf_he_destroy()
1103 cf_he_ctx_clear(cf, data); in cf_he_destroy()
1209 struct Curl_cfilter *cf; in cf_he_insert_after() local
1219 result = cf_happy_eyeballs_create(&cf, data, cf_at->conn, in cf_he_insert_after()
1225 Curl_conn_cf_insert_after(cf_at, cf); in cf_he_insert_after()
1246 static CURLcode cf_setup_connect(struct Curl_cfilter *cf, in cf_setup_connect() argument
1250 struct cf_setup_ctx *ctx = cf->ctx; in cf_setup_connect()
1253 if(cf->connected) { in cf_setup_connect()
1260 if(cf->next && !cf->next->connected) { in cf_setup_connect()
1261 result = Curl_conn_cf_connect(cf->next, data, blocking, done); in cf_setup_connect()
1267 result = cf_he_insert_after(cf, data, ctx->remotehost, ctx->transport); in cf_setup_connect()
1271 if(!cf->next || !cf->next->connected) in cf_setup_connect()
1277 if(ctx->state < CF_SETUP_CNNCT_SOCKS && cf->conn->bits.socksproxy) { in cf_setup_connect()
1278 result = Curl_cf_socks_proxy_insert_after(cf, data); in cf_setup_connect()
1282 if(!cf->next || !cf->next->connected) in cf_setup_connect()
1286 if(ctx->state < CF_SETUP_CNNCT_HTTP_PROXY && cf->conn->bits.httpproxy) { in cf_setup_connect()
1288 if(IS_HTTPS_PROXY(cf->conn->http_proxy.proxytype) in cf_setup_connect()
1289 && !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { in cf_setup_connect()
1290 result = Curl_cf_ssl_proxy_insert_after(cf, data); in cf_setup_connect()
1297 if(cf->conn->bits.tunnel_proxy) { in cf_setup_connect()
1298 result = Curl_cf_http_proxy_insert_after(cf, data); in cf_setup_connect()
1304 if(!cf->next || !cf->next->connected) in cf_setup_connect()
1312 if(Curl_conn_is_ssl(cf->conn, cf->sockindex)) { in cf_setup_connect()
1317 result = Curl_cf_haproxy_insert_after(cf, data); in cf_setup_connect()
1323 if(!cf->next || !cf->next->connected) in cf_setup_connect()
1331 && cf->conn->handler->flags & PROTOPT_SSL)) /* we want SSL */ in cf_setup_connect()
1332 && !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { /* it is missing */ in cf_setup_connect()
1333 result = Curl_cf_ssl_insert_after(cf, data); in cf_setup_connect()
1339 if(!cf->next || !cf->next->connected) in cf_setup_connect()
1344 cf->connected = TRUE; in cf_setup_connect()
1349 static void cf_setup_close(struct Curl_cfilter *cf, in cf_setup_close() argument
1352 struct cf_setup_ctx *ctx = cf->ctx; in cf_setup_close()
1354 CURL_TRC_CF(data, cf, "close"); in cf_setup_close()
1355 cf->connected = FALSE; in cf_setup_close()
1358 if(cf->next) { in cf_setup_close()
1359 cf->next->cft->do_close(cf->next, data); in cf_setup_close()
1360 Curl_conn_cf_discard_chain(&cf->next, data); in cf_setup_close()
1364 static void cf_setup_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_setup_destroy() argument
1366 struct cf_setup_ctx *ctx = cf->ctx; in cf_setup_destroy()
1369 CURL_TRC_CF(data, cf, "destroy"); in cf_setup_destroy()
1399 struct Curl_cfilter *cf = NULL; in cf_setup_create() local
1414 result = Curl_cf_create(&cf, &Curl_cft_setup, ctx); in cf_setup_create()
1420 *pcf = result ? NULL : cf; in cf_setup_create()
1432 struct Curl_cfilter *cf; in cf_setup_add() local
1436 result = cf_setup_create(&cf, data, remotehost, transport, ssl_mode); in cf_setup_add()
1439 Curl_conn_cf_add(data, conn, sockindex, cf); in cf_setup_add()
1465 struct Curl_cfilter *cf; in Curl_cf_setup_insert_after() local
1469 result = cf_setup_create(&cf, data, remotehost, transport, ssl_mode); in Curl_cf_setup_insert_after()
1472 Curl_conn_cf_insert_after(cf_at, cf); in Curl_cf_setup_insert_after()