ostree/0001-fetcher-curl-Stop-using-CURLOPT_LOW_SPEED_TIME-_LIMI.patch

44 lines
1.8 KiB
Diff
Raw Normal View History

From 69e00fc506e6a6d368a6e276eeb376e3d88b2fc7 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Mon, 27 Nov 2017 11:05:07 -0500
Subject: [PATCH] fetcher/curl: Stop using CURLOPT_LOW_SPEED_TIME/_LIMIT
They don't play nicely currently with HTTP2 where we may
have lots of requests queued.
https://github.com/ostreedev/ostree/issues/878#issuecomment-347228854
In practice anyways I think issues here are better solved on a higher level -
e.g. apps today can use an overall timeout on pulls and if they exceed the limit
set the cancellable.
Closes: #1349
Approved by: alexlarsson
---
src/libostree/ostree-fetcher-curl.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c
index 8a23b163..58835529 100644
--- a/src/libostree/ostree-fetcher-curl.c
+++ b/src/libostree/ostree-fetcher-curl.c
@@ -788,8 +788,13 @@ initiate_next_curl_request (FetcherRequest *req,
curl_easy_setopt (req->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
curl_easy_setopt (req->easy, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt (req->easy, CURLOPT_CONNECTTIMEOUT, 30L);
- curl_easy_setopt (req->easy, CURLOPT_LOW_SPEED_LIMIT, 1L);
- curl_easy_setopt (req->easy, CURLOPT_LOW_SPEED_TIME, 30L);
+ /* We used to set CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME
+ * here, but see https://github.com/ostreedev/ostree/issues/878#issuecomment-347228854
+ * basically those options don't play well with HTTP2 at the moment
+ * where we can have lots of outstanding requests. Further,
+ * we could implement that functionality at a higher level
+ * more consistently too.
+ */
/* closure bindings -> task */
curl_easy_setopt (req->easy, CURLOPT_PRIVATE, task);
--
2.14.2