diff options
author | Javier Blazquez <jblazquez@riotgames.com> | 2019-10-27 15:48:43 -0700 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-10-28 09:21:43 +0100 |
commit | e0ee3d9f9b6f4ad2165bfbfdef5812ca9d01d924 (patch) | |
tree | 23c86d81ee6c6c4792ef8e2cdefdea201169dc2f /lib/connect.c | |
parent | 0f234a5cdebd455f324cdf64b604b4a1340dbbfe (diff) | |
download | curl-e0ee3d9f9b6f4ad2165bfbfdef5812ca9d01d924.tar.gz |
HTTP3: fix Windows build
The ngtcp2 QUIC backend was using the MSG_DONTWAIT flag for send/recv
in order to perform nonblocking operations. On Windows this flag does
not exist. Instead, the socket must be set to nonblocking mode via
ioctlsocket.
This change sets the nonblocking flag on UDP sockets used for QUIC on
all platforms so the use of MSG_DONTWAIT is not needed.
Fixes #4531
Closes #4532
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c index 4c8c956a4..3b88a5962 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -1516,6 +1516,11 @@ CURLcode Curl_socket(struct connectdata *conn, /* no socket, no connection */ return CURLE_COULDNT_CONNECT; + if(conn->transport == TRNSPRT_QUIC) { + /* QUIC sockets need to be nonblocking */ + (void)curlx_nonblock(*sockfd, TRUE); + } + #if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) if(conn->scope_id && (addr->family == AF_INET6)) { struct sockaddr_in6 * const sa6 = (void *)&addr->sa_addr; |