mirror of
https://github.com/curl/curl.git
synced 2026-08-04 11:46:14 +03:00
connection: clarify transport
The `transport` to use for a transfer, e.g. TCP/QUIC/UNIX/UDP, is initially selected by options and protocol used. This is set at the `struct connectdata` as `transport` member. During connection establishment, this transport may change due to Alt-Svc or Happy-Eyeballing. Most common is the switch from TCP to QUIC. Rename the connection member to `transport_wanted` and add a way to query the connection for the transport in use via a new connection filter query. The filter query can also be used in the happy eyeballing attempts when code needs to know which transport is used by the "filter below". This happens in wolfssl initialization, as one example. Closes #17923
This commit is contained in:
parent
674ad27f77
commit
e9ae1bd404
16 changed files with 84 additions and 30 deletions
|
|
@ -1683,6 +1683,10 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf,
|
|||
DEBUGASSERT(pres2);
|
||||
*((curl_socket_t *)pres2) = ctx->sock;
|
||||
return CURLE_OK;
|
||||
case CF_QUERY_TRANSPORT:
|
||||
DEBUGASSERT(pres1);
|
||||
*pres1 = ctx->transport;
|
||||
return CURLE_OK;
|
||||
case CF_QUERY_REMOTE_ADDR:
|
||||
DEBUGASSERT(pres2);
|
||||
*((const struct Curl_sockaddr_ex **)pres2) = cf->connected ?
|
||||
|
|
@ -2193,7 +2197,7 @@ CURLcode Curl_conn_tcp_listen_set(struct Curl_easy *data,
|
|||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
}
|
||||
ctx->transport = conn->transport;
|
||||
ctx->transport = TRNSPRT_TCP;
|
||||
ctx->sock = *s;
|
||||
ctx->listening = TRUE;
|
||||
ctx->accepted = FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue