1
0
mirror of https://github.com/moparisthebest/curl synced 2025-01-11 05:58:01 -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:
Daniel Stenberg 2020-04-07 23:15:30 +02:00
parent 860eaebae6
commit 0bcf975c38
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -679,10 +679,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
connection */
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
{
if(conn->transport != TRNSPRT_TCP)
/* there's no TCP connection! */
return;
if(conn->transport == TRNSPRT_TCP) {
#if defined(HAVE_GETPEERNAME) || defined(HAVE_GETSOCKNAME)
if(!conn->bits.reuse && !conn->bits.tcp_fastopen) {
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 */
(void)sockfd; /* unused */
#endif
} /* end of TCP-only section */
/* persist connection info in session handle */
Curl_persistconninfo(conn);
@ -872,6 +870,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
conn->sock[sockindex] = conn->tempsock[i];
conn->ip_addr = conn->tempaddr[i];
conn->tempsock[i] = CURL_SOCKET_BAD;
post_SOCKS(conn, sockindex, connected);
connkeep(conn, "HTTP/3 default");
}
return result;