curl: fix regressions in 7.69.0.

crates.io is broken (and probably other stuff, too).
https://github.com/rust-lang/cargo/issues/7974
This commit is contained in:
travankor 2020-03-08 07:07:40 -07:00 committed by Juan RP
parent acab66146a
commit d88ff1cf5e
3 changed files with 90 additions and 1 deletions

View file

@ -0,0 +1,55 @@
From 8aa04e9a24932b830bc5eaf6838dea5a3329341e Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 5 Mar 2020 23:45:36 +0100
Subject: [PATCH] Revert "pause: force-drain the transfer on unpause"
This reverts commit fa0216b294af4c7113a9040ca65eefc7fc18ac1c (from #5000)
Clearly that didn't solve the problem correctly.
Reported-by: Christopher Reid
Reopens #4966
Fixes #5044
---
lib/easy.c | 1 -
lib/transfer.c | 5 ++---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/easy.c b/lib/easy.c
index 1a6912748..454621076 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -1033,7 +1033,6 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
to have this handle checked soon */
if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) !=
(KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) {
- data->state.drain++;
Curl_expire(data, 0, EXPIRE_RUN_NOW); /* get this handle going again */
if(data->multi)
Curl_update_timer(data->multi);
diff --git a/lib/transfer.c b/lib/transfer.c
index 827076183..ead8b36db 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1217,8 +1217,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
else
fd_write = CURL_SOCKET_BAD;
- if(data->state.drain) {
- data->state.drain--;
+ if(conn->data->state.drain) {
select_res |= CURL_CSELECT_IN;
DEBUGF(infof(data, "Curl_readwrite: forcibly told to drain data\n"));
}
--
2.25.1

View file

@ -0,0 +1,33 @@
From e040146f22608fd92c44be2447a6505141a8a867 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Fri, 6 Mar 2020 10:04:28 +0100
Subject: [PATCH] pause: force a connection (re-)check after unpausing
There might be data available that was already read off the socket, for
example in the TLS layer.
Reported-by: Anders Berg
Fixes #4966
Closes #5049
---
lib/easy.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/easy.c b/lib/easy.c
index 33bc1aab7..f7a6d5c60 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -1047,6 +1047,10 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) !=
(KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) {
Curl_expire(data, 0, EXPIRE_RUN_NOW); /* get this handle going again */
+
+ /* force a recv/send check of this connection, as the data might've been
+ read off the socket already */
+ data->conn->cselect_bits = CURL_CSELECT_IN | CURL_CSELECT_OUT;
if(data->multi)
Curl_update_timer(data->multi);
}
--
2.25.1

View file

@ -1,7 +1,7 @@
# Template file for 'curl'
pkgname=curl
version=7.69.0
revision=1
revision=2
build_style=gnu-configure
configure_args="ac_cv_sizeof_off_t=8 --enable-threaded-resolver --enable-ipv6
$(vopt_with rtmp) $(vopt_with gssapi) $(vopt_enable ldap) $(vopt_with gnutls)
@ -21,6 +21,7 @@ homepage="https://curl.haxx.se"
changelog="https://curl.haxx.se/changes.html#${version//./_}"
distfiles="${homepage}/download/${pkgname}-${version}.tar.bz2"
checksum=668d451108a7316cff040b23c79bc766e7ed84122074e44f662b8982f2e76739
patch_args="-Np1"
build_options="gnutls gssapi ldap rtmp ssh ssl"
build_options_default="ssh ssl"
vopt_conflict ssl gnutls