summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/cf-https-connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/cf-https-connect.c')
-rw-r--r--libs/libcurl/src/cf-https-connect.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/libs/libcurl/src/cf-https-connect.c b/libs/libcurl/src/cf-https-connect.c
index 31a0ac65e8..3d1cdca111 100644
--- a/libs/libcurl/src/cf-https-connect.c
+++ b/libs/libcurl/src/cf-https-connect.c
@@ -174,6 +174,7 @@ static CURLcode baller_connected(struct Curl_cfilter *cf,
{
struct cf_hc_ctx *ctx = cf->ctx;
CURLcode result = CURLE_OK;
+ int reply_ms;
DEBUGASSERT(winner->cf);
if(winner != &ctx->h3_baller)
@@ -181,9 +182,15 @@ static CURLcode baller_connected(struct Curl_cfilter *cf,
if(winner != &ctx->h21_baller)
cf_hc_baller_reset(&ctx->h21_baller, data);
- CURL_TRC_CF(data, cf, "connect+handshake %s: %dms, 1st data: %dms",
- winner->name, (int)Curl_timediff(Curl_now(), winner->started),
- cf_hc_baller_reply_ms(winner, data));
+ reply_ms = cf_hc_baller_reply_ms(winner, data);
+ if(reply_ms >= 0)
+ CURL_TRC_CF(data, cf, "connect+handshake %s: %dms, 1st data: %dms",
+ winner->name, (int)Curl_timediff(Curl_now(), winner->started),
+ reply_ms);
+ else
+ CURL_TRC_CF(data, cf, "deferred handshake %s: %dms",
+ winner->name, (int)Curl_timediff(Curl_now(), winner->started));
+
cf->next = winner->cf;
winner->cf = NULL;
@@ -275,7 +282,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
}
else if(ctx->h21_baller.enabled)
cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21",
- cf->conn->transport);
+ cf->conn->transport);
ctx->state = CF_HC_CONNECT;
FALLTHROUGH();
@@ -306,8 +313,8 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
(!ctx->h21_baller.enabled || ctx->h21_baller.result)) {
/* both failed or disabled. we give up */
CURL_TRC_CF(data, cf, "connect, all failed");
- result = ctx->result = ctx->h3_baller.enabled?
- ctx->h3_baller.result : ctx->h21_baller.result;
+ result = ctx->result = ctx->h3_baller.enabled ?
+ ctx->h3_baller.result : ctx->h21_baller.result;
ctx->state = CF_HC_FAILURE;
goto out;
}
@@ -420,13 +427,13 @@ static struct curltime cf_get_max_baller_time(struct Curl_cfilter *cf,
memset(&tmax, 0, sizeof(tmax));
memset(&t, 0, sizeof(t));
- cfb = ctx->h21_baller.enabled? ctx->h21_baller.cf : NULL;
+ cfb = ctx->h21_baller.enabled ? ctx->h21_baller.cf : NULL;
if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0)
tmax = t;
}
memset(&t, 0, sizeof(t));
- cfb = ctx->h3_baller.enabled? ctx->h3_baller.cf : NULL;
+ cfb = ctx->h3_baller.enabled ? ctx->h3_baller.cf : NULL;
if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0)
tmax = t;
@@ -464,7 +471,7 @@ static CURLcode cf_hc_query(struct Curl_cfilter *cf,
break;
}
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -553,7 +560,7 @@ static CURLcode cf_hc_create(struct Curl_cfilter **pcf,
cf_hc_reset(cf, data);
out:
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
free(ctx);
return result;
}