[arch-commits] Commit in curl/trunk (2 files)

Dave Reisner dreisner at nymeria.archlinux.org
Sat Dec 28 17:20:56 UTC 2013


    Date: Saturday, December 28, 2013 @ 18:20:55
  Author: dreisner
Revision: 202854

upgpkg: curl 7.34.0-2

- backport fix for potential connection failures with dual stack

Added:
  curl/trunk/0001-connect-Try-all-addresses-in-first-connection-attemp.patch
Modified:
  curl/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-connect-Try-all-addresses-in-first-connection-attemp.patch |   47 ++++++++++
 PKGBUILD                                                        |   10 +-
 2 files changed, 56 insertions(+), 1 deletion(-)

Added: 0001-connect-Try-all-addresses-in-first-connection-attemp.patch
===================================================================
--- 0001-connect-Try-all-addresses-in-first-connection-attemp.patch	                        (rev 0)
+++ 0001-connect-Try-all-addresses-in-first-connection-attemp.patch	2013-12-28 17:20:55 UTC (rev 202854)
@@ -0,0 +1,47 @@
+From 4e1ece2e44f432c2614f2090155c0aaf2226ea80 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= <bjorn at haxx.se>
+Date: Sat, 28 Dec 2013 13:42:57 +0100
+Subject: [PATCH] connect: Try all addresses in first connection attempt
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes a bug when all addresses in the first family fail immediately, due
+to "Network unreachable" for example, curl would hang and never try the
+next address family.
+
+Iterate through all address families when to trying establish the first
+connection attempt.
+
+Bug: http://curl.haxx.se/bug/view.cgi?id=1315
+Reported-by: Michal Górny and Anthony G. Basile
+---
+ lib/connect.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/lib/connect.c b/lib/connect.c
+index 4b6ee00..588ac28 100644
+--- a/lib/connect.c
++++ b/lib/connect.c
+@@ -1104,12 +1104,12 @@ CURLcode Curl_connecthost(struct connectdata *conn,  /* context */
+     conn->tempaddr[0]->ai_next == NULL ? timeout_ms : timeout_ms / 2;
+ 
+   /* start connecting to first IP */
+-  res = singleipconnect(conn, conn->tempaddr[0], &(conn->tempsock[0]));
+-  while(res != CURLE_OK &&
+-        conn->tempaddr[0] &&
+-        conn->tempaddr[0]->ai_next &&
+-        conn->tempsock[0] == CURL_SOCKET_BAD)
+-    res = trynextip(conn, FIRSTSOCKET, 0);
++  while(conn->tempaddr[0]) {
++    res = singleipconnect(conn, conn->tempaddr[0], &(conn->tempsock[0]));
++    if(res == CURLE_OK)
++        break;
++    conn->tempaddr[0] = conn->tempaddr[0]->ai_next;
++  }
+ 
+   if(conn->tempsock[0] == CURL_SOCKET_BAD)
+     return res;
+-- 
+1.8.5.2
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-12-28 16:01:01 UTC (rev 202853)
+++ PKGBUILD	2013-12-28 17:20:55 UTC (rev 202854)
@@ -7,7 +7,7 @@
 
 pkgname=curl
 pkgver=7.34.0
-pkgrel=1
+pkgrel=2
 pkgdesc="An URL retrieval utility and library"
 arch=('i686' 'x86_64')
 url="http://curl.haxx.se"
@@ -16,11 +16,19 @@
 provides=('libcurl.so')
 options=('strip' 'debug')
 source=("http://curl.haxx.se/download/$pkgname-$pkgver.tar.gz"{,.asc}
+        0001-connect-Try-all-addresses-in-first-connection-attemp.patch
         curlbuild.h)
 md5sums=('d5b7edccbd1793e3549842e01331da20'
          'SKIP'
+         'ee755b0e886207fc1e8154e426c46ca7'
          '751bd433ede935c8fae727377625a8ae')
 
+prepare() {
+  cd "$pkgname-$pkgver"
+
+  patch -Np1 <"$srcdir"/0001-connect-Try-all-addresses-in-first-connection-attemp.patch
+}
+
 build() {
   cd "$pkgname-$pkgver"
 




More information about the arch-commits mailing list