gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnurl] 84/116: macOS: Fix missing connectx function with X


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 84/116: macOS: Fix missing connectx function with Xcode version older than 9.0
Date: Tue, 05 Dec 2017 14:51:54 +0100

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

ng0 pushed a commit to branch master
in repository gnurl.

commit 6ce98456774792ee5fd798f18660d98facede739
Author: Pavol Markovic <address@hidden>
AuthorDate: Wed Nov 15 15:35:14 2017 +1300

    macOS: Fix missing connectx function with Xcode version older than 9.0
    
    The previous fix https://github.com/curl/curl/pull/1788 worked just for
    Xcode 9. This commit extends the fix to older Xcode versions effectively
    by not using connectx function.
    
    Fixes https://github.com/curl/curl/issues/1330
    Fixes https://github.com/curl/curl/issues/2080
    Closes https://github.com/curl/curl/pull/1336
    Closes #2082
---
 lib/connect.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/connect.c b/lib/connect.c
index d47c1b996..16104bc4f 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -1065,10 +1065,12 @@ static CURLcode singleipconnect(struct connectdata 
*conn,
   /* Connect TCP sockets, bind UDP */
   if(!isconnected && (conn->socktype == SOCK_STREAM)) {
     if(conn->bits.tcp_fastopen) {
-#if defined(CONNECT_DATA_IDEMPOTENT) /* OS X */
-#ifdef HAVE_BUILTIN_AVAILABLE
+#if defined(CONNECT_DATA_IDEMPOTENT) /* Darwin */
+#  if defined(HAVE_BUILTIN_AVAILABLE)
+      /* while connectx function is available since macOS 10.11 / iOS 9,
+         it did not have the interface declared correctly until
+         Xcode 9 / macOS SDK 10.13 */
       if(__builtin_available(macOS 10.11, iOS 9.0, tvOS 9.0, watchOS 2.0, *)) {
-#endif /* HAVE_BUILTIN_AVAILABLE */
         sa_endpoints_t endpoints;
         endpoints.sae_srcif = 0;
         endpoints.sae_srcaddr = NULL;
@@ -1079,12 +1081,13 @@ static CURLcode singleipconnect(struct connectdata 
*conn,
         rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
                       CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT,
                       NULL, 0, NULL, NULL);
-#ifdef HAVE_BUILTIN_AVAILABLE
       }
       else {
         rc = connect(sockfd, &addr.sa_addr, addr.addrlen);
       }
-#endif /* HAVE_BUILTIN_AVAILABLE */
+#  else
+      rc = connect(sockfd, &addr.sa_addr, addr.addrlen);
+#  endif /* HAVE_BUILTIN_AVAILABLE */
 #elif defined(MSG_FASTOPEN) /* Linux */
       if(conn->given->flags & PROTOPT_SSL)
         rc = connect(sockfd, &addr.sa_addr, addr.addrlen);

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



reply via email to

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