diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-30 09:06:17 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-30 09:07:13 +0000 |
commit | 31af0ed36e39b56a69786e3d904997d093d04c91 (patch) | |
tree | 0ea2b0a43dfb449294d3d870edc475d4f6c008d6 | |
parent | 087ea64c74f1c67245788bd5c96760e750e8eb91 (diff) | |
download | aports-31af0ed36e39b56a69786e3d904997d093d04c91.tar.bz2 aports-31af0ed36e39b56a69786e3d904997d093d04c91.tar.xz |
main/curl: fix curl hanging
http://sourceforge.net/p/curl/bugs/1315/
-rw-r--r-- | main/curl/0001-connect-Try-all-addresses-in-first-connection-attemp.patch | 47 | ||||
-rw-r--r-- | main/curl/APKBUILD | 14 |
2 files changed, 56 insertions, 5 deletions
diff --git a/main/curl/0001-connect-Try-all-addresses-in-first-connection-attemp.patch b/main/curl/0001-connect-Try-all-addresses-in-first-connection-attemp.patch new file mode 100644 index 0000000000..f3428c7d5d --- /dev/null +++ b/main/curl/0001-connect-Try-all-addresses-in-first-connection-attemp.patch @@ -0,0 +1,47 @@ +From 4e1ece2e44f432c2614f2090155c0aaf2226ea80 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= <bjorn@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 + diff --git a/main/curl/APKBUILD b/main/curl/APKBUILD index 96a672f965..4665fe9488 100644 --- a/main/curl/APKBUILD +++ b/main/curl/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=curl pkgver=7.34.0 -pkgrel=0 +pkgrel=1 pkgdesc="An URL retrival utility and library" url="http://curl.haxx.se" arch="all" @@ -9,7 +9,8 @@ license="MIT" depends="ca-certificates" depends_dev="zlib-dev openssl-dev libssh2-dev" makedepends="$depends_dev" -source="http://curl.haxx.se/download/curl-$pkgver.tar.bz2" +source="http://curl.haxx.se/download/curl-$pkgver.tar.bz2 + 0001-connect-Try-all-addresses-in-first-connection-attemp.patch" subpackages="$pkgname-doc $pkgname-dev" _builddir="$srcdir/$pkgname-$pkgver" @@ -43,6 +44,9 @@ package() { rm "$pkgdir"/usr/lib/*.la || return 1 } -md5sums="88491df2bb32e9146e776ae6ac2f8327 curl-7.34.0.tar.bz2" -sha256sums="10beade56b48311499e444783df3413405b22f20a147ed4a1d8a8125f1cc829b curl-7.34.0.tar.bz2" -sha512sums="7158521e5d75f3f7e0373bed7a4e71351699239f7109ef43363d6f09c7bf6d65b64c3b54b62e65c709761cba2e08e35b728ac7458fbd68fe249b8471cce86971 curl-7.34.0.tar.bz2" +md5sums="88491df2bb32e9146e776ae6ac2f8327 curl-7.34.0.tar.bz2 +ee755b0e886207fc1e8154e426c46ca7 0001-connect-Try-all-addresses-in-first-connection-attemp.patch" +sha256sums="10beade56b48311499e444783df3413405b22f20a147ed4a1d8a8125f1cc829b curl-7.34.0.tar.bz2 +60502a73d69abdc11444ada436bc46157470f68b0af0eaec5f4fc6322d25e37c 0001-connect-Try-all-addresses-in-first-connection-attemp.patch" +sha512sums="7158521e5d75f3f7e0373bed7a4e71351699239f7109ef43363d6f09c7bf6d65b64c3b54b62e65c709761cba2e08e35b728ac7458fbd68fe249b8471cce86971 curl-7.34.0.tar.bz2 +fdbf372c912b39c910c9b3e9f3efb3038280b9e9e48b613790915ea9579f2d1ab373e6e6de939ff81ac87e557177df02fabdb6f4a9ca38849e3cc84fddc054f3 0001-connect-Try-all-addresses-in-first-connection-attemp.patch" |