mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 17:18:48 -05:00
connect: store connection info for QUIC connections
Restores the --head functionality to the curl utility which extracts 'protocol' that is stored that way. Reported-by: James Fuller Fixes #5196 Closes #5198
This commit is contained in:
parent
860eaebae6
commit
0bcf975c38
@ -679,10 +679,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
|
|||||||
connection */
|
connection */
|
||||||
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
||||||
{
|
{
|
||||||
if(conn->transport != TRNSPRT_TCP)
|
if(conn->transport == TRNSPRT_TCP) {
|
||||||
/* there's no TCP connection! */
|
|
||||||
return;
|
|
||||||
|
|
||||||
#if defined(HAVE_GETPEERNAME) || defined(HAVE_GETSOCKNAME)
|
#if defined(HAVE_GETPEERNAME) || defined(HAVE_GETSOCKNAME)
|
||||||
if(!conn->bits.reuse && !conn->bits.tcp_fastopen) {
|
if(!conn->bits.reuse && !conn->bits.tcp_fastopen) {
|
||||||
struct Curl_easy *data = conn->data;
|
struct Curl_easy *data = conn->data;
|
||||||
@ -731,6 +728,7 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
|||||||
#else /* !HAVE_GETSOCKNAME && !HAVE_GETPEERNAME */
|
#else /* !HAVE_GETSOCKNAME && !HAVE_GETPEERNAME */
|
||||||
(void)sockfd; /* unused */
|
(void)sockfd; /* unused */
|
||||||
#endif
|
#endif
|
||||||
|
} /* end of TCP-only section */
|
||||||
|
|
||||||
/* persist connection info in session handle */
|
/* persist connection info in session handle */
|
||||||
Curl_persistconninfo(conn);
|
Curl_persistconninfo(conn);
|
||||||
@ -872,6 +870,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
conn->sock[sockindex] = conn->tempsock[i];
|
conn->sock[sockindex] = conn->tempsock[i];
|
||||||
conn->ip_addr = conn->tempaddr[i];
|
conn->ip_addr = conn->tempaddr[i];
|
||||||
conn->tempsock[i] = CURL_SOCKET_BAD;
|
conn->tempsock[i] = CURL_SOCKET_BAD;
|
||||||
|
post_SOCKS(conn, sockindex, connected);
|
||||||
connkeep(conn, "HTTP/3 default");
|
connkeep(conn, "HTTP/3 default");
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user