Subject: [alpine-aports] [PATCH for 3.4-stable] main/curl: Fix socket removal when multi_socket API is used (timeouts).

From: Przemyslaw Pawelczyk <[email-masked]>
Date: Sun, 19 Feb 2017 14:56:12 +0100

It's a fix (curl's a7b38c9) for regression in v7.52.0 (curl's cb4e2be).

https://github.com/curl/curl/issues/1174

Without this patch apps like rtorrent don't work with HTTPS stuff.
---

It's definitely a material for master and 3.5-stable too, but I'm still
on 3.4-stable and that's the environment I tested the fixed curl on.

 main/curl/0001-vtls-s-SSLEAY-OPENSSL.patch | 39 ++++++++++++++++++++++++++++++
 main/curl/APKBUILD                         | 14 +++++++----
 2 files changed, 48 insertions(+), 5 deletions(-)
 create mode 100644 main/curl/0001-vtls-s-SSLEAY-OPENSSL.patch

diff --git a/main/curl/0001-vtls-s-SSLEAY-OPENSSL.patch b/main/curl/0001-vtls-s-SSLEAY-OPENSSL.patch
new file mode 100644
index 000000000000..9cff3d733823
--- /dev/null
+++ b/main/curl/0001-vtls-s-SSLEAY-OPENSSL.patch
@@ -0,0 +1,39 @@
+From a7b38c9dc98481e4a5fc37e51a8690337c674dfb Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email-masked]>
+Date: Mon, 26 Dec 2016 00:06:33 +0100
+Subject: [PATCH] vtls: s/SSLEAY/OPENSSL
+
+Fixed an old leftover use of the USE_SSLEAY define which would make a
+socket get removed from the applications sockets to monitor when the
+multi_socket API was used, leading to timeouts.
+
+Bug: #1174
+---
+ lib/vtls/vtls.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
+index b808e1c5fef8..707f24b02373 100644
+--- a/lib/vtls/vtls.c
++++ b/lib/vtls/vtls.c
+@@ -484,7 +484,7 @@ void Curl_ssl_close_all(struct Curl_easy *data)
+   curlssl_close_all(data);
+ }
+ 
+-#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \
++#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \
+     defined(USE_DARWINSSL) || defined(USE_NSS)
+ /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. */
+ int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks,
+@@ -518,7 +518,7 @@ int Curl_ssl_getsock(struct connectdata *conn,
+   (void)numsocks;
+   return GETSOCK_BLANK;
+ }
+-/* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */
++/* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */
+ #endif
+ 
+ void Curl_ssl_close(struct connectdata *conn, int sockindex)
+-- 
+2.8.3
+
diff --git a/main/curl/APKBUILD b/main/curl/APKBUILD
index 9255bfb22070..16895b5c7a51 100644
--- a/main/curl/APKBUILD
+++ b/main/curl/APKBUILD
@@ -4,7 +4,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=curl
 pkgver=7.52.1
-pkgrel=0
+pkgrel=1
 pkgdesc="An URL retrival utility and library"
 url="http://curl.haxx.se"
 arch="all"
@@ -12,7 +12,8 @@ license="MIT"
 depends="ca-certificates"
 depends_dev="zlib-dev openssl-dev libssh2-dev"
 makedepends="$depends_dev groff perl"
-source="http://curl.haxx.se/download/$pkgname-$pkgver.tar.bz2"
+source="http://curl.haxx.se/download/$pkgname-$pkgver.tar.bz2
+        0001-vtls-s-SSLEAY-OPENSSL.patch"
 subpackages="$pkgname-doc $pkgname-dev libcurl"
 
 # secfixes:
@@ -84,6 +85,9 @@ libcurl() {
 	mv "$pkgdir"/usr/lib "$subpkgdir"/usr
 }
 
-md5sums="dd014df06ff1d12e173de86873f9f77a  curl-7.52.1.tar.bz2"
-sha256sums="d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b  curl-7.52.1.tar.bz2"
-sha512sums="cf36563c77d096f2c6084354ed6d45ccca7c557828ceab21204e4e8be0d4f0d287839c8cfac906174b86d51a1ee816c2769fc78ef88f039c9645bd2c27982a75  curl-7.52.1.tar.bz2"
+md5sums="dd014df06ff1d12e173de86873f9f77a  curl-7.52.1.tar.bz2
+22bff656c24c85df60e745f2c0847905  0001-vtls-s-SSLEAY-OPENSSL.patch"
+sha256sums="d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b  curl-7.52.1.tar.bz2
+c28962b414caba7d4a097081c276dd108a8406d63da09177dcc0aa5eaf2cdffa  0001-vtls-s-SSLEAY-OPENSSL.patch"
+sha512sums="cf36563c77d096f2c6084354ed6d45ccca7c557828ceab21204e4e8be0d4f0d287839c8cfac906174b86d51a1ee816c2769fc78ef88f039c9645bd2c27982a75  curl-7.52.1.tar.bz2
+9c18a692ddbc6fcdae84f1c496905b5f1d2fb76458f8f6ea29ba9ecede53dc5c210e8691b07d0ab56832074e529fd2670ae1301e2cd6693d50bd55ef0e331565  0001-vtls-s-SSLEAY-OPENSSL.patch"
-- 
2.8.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---