Lines Matching refs:ctx

475   struct cf_he_ctx *ctx = cf->ctx;  in baller_initiate()  local
486 ctx->transport); in baller_initiate()
607 struct cf_he_ctx *ctx = cf->ctx; in is_connected() local
625 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in is_connected()
626 struct eyeballer *baller = ctx->baller[i]; in is_connected()
642 ctx->winner = baller; in is_connected()
643 ctx->baller[i] = NULL; in is_connected()
669 if(ctx->winner) { in is_connected()
686 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in is_connected()
687 struct eyeballer *baller = ctx->baller[i]; in is_connected()
694 Curl_timediff(now, ctx->started) >= baller->delay_ms) { in is_connected()
720 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in is_connected()
721 struct eyeballer *baller = ctx->baller[i]; in is_connected()
769 struct cf_he_ctx *ctx = cf->ctx; in start_connect() local
782 ctx->started = Curl_now(); in start_connect()
832 memset(ctx->baller, 0, sizeof(ctx->baller)); in start_connect()
833 result = eyeballer_new(&ctx->baller[0], ctx->cf_create, addr0, ai_family0, in start_connect()
839 ctx->baller[0]->name, ctx->baller[0]->timeoutms); in start_connect()
842 result = eyeballer_new(&ctx->baller[1], ctx->cf_create, addr1, ai_family1, in start_connect()
843 ctx->baller[0], /* wait on that to fail */ in start_connect()
850 ctx->baller[1]->name, ctx->baller[1]->timeoutms); in start_connect()
860 struct cf_he_ctx *ctx = cf->ctx; in cf_he_ctx_clear() local
863 DEBUGASSERT(ctx); in cf_he_ctx_clear()
865 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_ctx_clear()
866 baller_free(ctx->baller[i], data); in cf_he_ctx_clear()
867 ctx->baller[i] = NULL; in cf_he_ctx_clear()
869 baller_free(ctx->winner, data); in cf_he_ctx_clear()
870 ctx->winner = NULL; in cf_he_ctx_clear()
876 struct cf_he_ctx *ctx = cf->ctx; in cf_he_shutdown() local
888 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_shutdown()
889 struct eyeballer *baller = ctx->baller[i]; in cf_he_shutdown()
899 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_shutdown()
900 if(ctx->baller[i] && !ctx->baller[i]->shutdown) in cf_he_shutdown()
904 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_shutdown()
905 if(ctx->baller[i] && ctx->baller[i]->result) in cf_he_shutdown()
906 result = ctx->baller[i]->result; in cf_he_shutdown()
917 struct cf_he_ctx *ctx = cf->ctx; in cf_he_adjust_pollset() local
921 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_adjust_pollset()
922 struct eyeballer *baller = ctx->baller[i]; in cf_he_adjust_pollset()
935 struct cf_he_ctx *ctx = cf->ctx; in cf_he_connect() local
944 DEBUGASSERT(ctx); in cf_he_connect()
947 switch(ctx->state) { in cf_he_connect()
951 result = start_connect(cf, data, ctx->remotehost); in cf_he_connect()
954 ctx->state = SCFST_WAITING; in cf_he_connect()
959 DEBUGASSERT(ctx->winner); in cf_he_connect()
960 DEBUGASSERT(ctx->winner->cf); in cf_he_connect()
961 DEBUGASSERT(ctx->winner->cf->connected); in cf_he_connect()
964 ctx->state = SCFST_DONE; in cf_he_connect()
966 cf->next = ctx->winner->cf; in cf_he_connect()
967 ctx->winner->cf = NULL; in cf_he_connect()
996 struct cf_he_ctx *ctx = cf->ctx; in cf_he_close() local
1001 ctx->state = SCFST_INIT; in cf_he_close()
1012 struct cf_he_ctx *ctx = cf->ctx; in cf_he_data_pending() local
1018 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_data_pending()
1019 struct eyeballer *baller = ctx->baller[i]; in cf_he_data_pending()
1032 struct cf_he_ctx *ctx = cf->ctx; in get_max_baller_time() local
1037 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in get_max_baller_time()
1038 struct eyeballer *baller = ctx->baller[i]; in get_max_baller_time()
1054 struct cf_he_ctx *ctx = cf->ctx; in cf_he_query() local
1062 for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { in cf_he_query()
1063 struct eyeballer *baller = ctx->baller[i]; in cf_he_query()
1099 struct cf_he_ctx *ctx = cf->ctx; in cf_he_destroy() local
1102 if(ctx) { in cf_he_destroy()
1106 Curl_safefree(ctx); in cf_he_destroy()
1146 struct cf_he_ctx *ctx = NULL; in cf_happy_eyeballs_create() local
1152 ctx = calloc(1, sizeof(*ctx)); in cf_happy_eyeballs_create()
1153 if(!ctx) { in cf_happy_eyeballs_create()
1157 ctx->transport = transport; in cf_happy_eyeballs_create()
1158 ctx->cf_create = cf_create; in cf_happy_eyeballs_create()
1159 ctx->remotehost = remotehost; in cf_happy_eyeballs_create()
1161 result = Curl_cf_create(pcf, &Curl_cft_happy_eyeballs, ctx); in cf_happy_eyeballs_create()
1166 Curl_safefree(ctx); in cf_happy_eyeballs_create()
1250 struct cf_setup_ctx *ctx = cf->ctx; in cf_setup_connect() local
1266 if(ctx->state < CF_SETUP_CNNCT_EYEBALLS) { in cf_setup_connect()
1267 result = cf_he_insert_after(cf, data, ctx->remotehost, ctx->transport); in cf_setup_connect()
1270 ctx->state = CF_SETUP_CNNCT_EYEBALLS; in cf_setup_connect()
1277 if(ctx->state < CF_SETUP_CNNCT_SOCKS && cf->conn->bits.socksproxy) { in cf_setup_connect()
1281 ctx->state = CF_SETUP_CNNCT_SOCKS; in cf_setup_connect()
1286 if(ctx->state < CF_SETUP_CNNCT_HTTP_PROXY && cf->conn->bits.httpproxy) { in cf_setup_connect()
1303 ctx->state = CF_SETUP_CNNCT_HTTP_PROXY; in cf_setup_connect()
1309 if(ctx->state < CF_SETUP_CNNCT_HAPROXY) { in cf_setup_connect()
1322 ctx->state = CF_SETUP_CNNCT_HAPROXY; in cf_setup_connect()
1327 if(ctx->state < CF_SETUP_CNNCT_SSL) { in cf_setup_connect()
1329 if((ctx->ssl_mode == CURL_CF_SSL_ENABLE in cf_setup_connect()
1330 || (ctx->ssl_mode != CURL_CF_SSL_DISABLE in cf_setup_connect()
1338 ctx->state = CF_SETUP_CNNCT_SSL; in cf_setup_connect()
1343 ctx->state = CF_SETUP_DONE; in cf_setup_connect()
1352 struct cf_setup_ctx *ctx = cf->ctx; in cf_setup_close() local
1356 ctx->state = CF_SETUP_INIT; in cf_setup_close()
1366 struct cf_setup_ctx *ctx = cf->ctx; in cf_setup_destroy() local
1370 Curl_safefree(ctx); in cf_setup_destroy()
1400 struct cf_setup_ctx *ctx; in cf_setup_create() local
1404 ctx = calloc(1, sizeof(*ctx)); in cf_setup_create()
1405 if(!ctx) { in cf_setup_create()
1409 ctx->state = CF_SETUP_INIT; in cf_setup_create()
1410 ctx->remotehost = remotehost; in cf_setup_create()
1411 ctx->ssl_mode = ssl_mode; in cf_setup_create()
1412 ctx->transport = transport; in cf_setup_create()
1414 result = Curl_cf_create(&cf, &Curl_cft_setup, ctx); in cf_setup_create()
1417 ctx = NULL; in cf_setup_create()
1421 free(ctx); in cf_setup_create()