From e2b39dd3a0742853e00f9c3e8c46c911da20bed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Tue, 30 Jun 2020 10:42:49 -0400 Subject: [PATCH 1/4] http/request: make terminate public --- include/opendht/http.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/opendht/http.h b/include/opendht/http.h index cc8d5f9..46b722c 100644 --- a/include/opendht/http.h +++ b/include/opendht/http.h @@ -294,6 +294,7 @@ public: * User action to cancel the Request and call the completion callbacks. */ void cancel(); + void terminate(const asio::error_code& ec); private: using OnCompleteCb = std::function; @@ -320,8 +321,6 @@ private: void connect(std::vector&& endpoints, HandlerCb cb = {}); - void terminate(const asio::error_code& ec); - void post(); void handle_request(const asio::error_code& ec); -- 2.27.0 right'>
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2023-06-08substitute: Gracefully retry after failed partial downloads....Fixes <https://issues.guix.gnu.org/63443>. Reported by Attila Lendvai <attila@lendvai.name>. * guix/scripts/substitute.scm (catch-system-error): New macro. (download-nar): Add call to 'delete-file-recursively'. * tests/substitute.scm ("substitute, previous partial download around"): New test. Ludovic Courtès
2023-05-30substitute: If a server's nar URL is 404, try the next one(s)....If a substitute server advertises in its narinfo, for example, both a /zstd and a /lzip URL but the /zstd URL is unreachable, try the /lzip URL. Fixes <https://issues.guix.gnu.org/63634>. * guix/narinfo.scm (narinfo-preferred-uris): New procedure. (narinfo-best-uri): Rebase on top of it. * guix/scripts/substitute.scm (download-nar)[try-fetch]: New procedure. Use 'narinfo-preferred-uris' and 'try-fetch' to attempt all the URLs of NARINFO. * tests/substitute.scm (request-substitution): Remove 'parameterize'. Delete DESTINATION. ("substitute, preferred nar URL is 404, other is 200"): New test. Ludovic Courtès
2022-09-28substitute: Retry downloading when a nar is unavailable....Fixes <https://issues.guix.gnu.org/57978> Reported by Attila Lendvai <attila@lendvai.name>. Previously, if a narinfo was available but its corresponding nar was missing (for instance because the narinfo was cached and the server became unreachable in the meantime), 'guix substitute --substitute' would try to download the nar from its preferred location and abort when that fails. This change forces one retry with each of the URLs. * guix/scripts/substitute.scm (download-nar): Do not catch 'http-get-error?' exceptions. (system-error?, network-error?, process-substitution/fallback): New procedures. (process-substitution): Call 'process-substitution/fallback' upon 'network-error?'. * tests/substitute.scm ("substitute, first URL has narinfo but lacks nar, second URL unauthorized") ("substitute, first URL has narinfo but nar is 404, both URLs authorized") ("substitute, first URL has narinfo but nar is 404, one URL authorized") ("substitute, narinfo is available but nar is missing"): New tests. Ludovic Courtès
2022-09-24substitute: Test behavior with unroutable substitute server addresses....* tests/substitute.scm (%unroutable-substitute-url): New variable. ("query narinfo signed with authorized key, unroutable URL first") ("substitute, authorized key, first substitute URL is unroutable"): New tests. Ludovic Courtès