gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 198/222: HTTP3: fix invalid use of sendto for connected UDP sock


From: gnunet
Subject: [gnurl] 198/222: HTTP3: fix invalid use of sendto for connected UDP socket
Date: Thu, 07 Nov 2019 00:11:34 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 9f5b26d23fe0d666debc4526abe7a078601e20dc
Author: Javier Blazquez <address@hidden>
AuthorDate: Sun Oct 27 17:16:24 2019 -0700

    HTTP3: fix invalid use of sendto for connected UDP socket
    
    On macOS/BSD, trying to call sendto on a connected UDP socket fails
    with a EISCONN error. Because the singleipconnect has already called
    connect on the socket when we're trying to use it for QUIC transfers
    we need to use plain send instead.
    
    Fixes #4529
    Closes https://github.com/curl/curl/pull/4533
---
 lib/vquic/ngtcp2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index 864751101..c0f9b16e3 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -1544,9 +1544,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, 
int sockfd,
     }
 
     memcpy(&remote_addr, ps.path.remote.addr, ps.path.remote.addrlen);
-    while((sent = sendto(sockfd, out, outlen, 0,
-                         (struct sockaddr *)&remote_addr,
-                         (socklen_t)ps.path.remote.addrlen)) == -1 &&
+    while((sent = send(sockfd, out, outlen, 0)) == -1 &&
           SOCKERRNO == EINTR)
       ;
 
@@ -1556,7 +1554,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, 
int sockfd,
         break;
       }
       else {
-        failf(conn->data, "sendto() returned %zd (errno %d)\n", sent,
+        failf(conn->data, "send() returned %zd (errno %d)\n", sent,
               SOCKERRNO);
         return CURLE_SEND_ERROR;
       }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]