From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OJQ6Fze7dGRSowAASxT56A (envelope-from ) for ; Mon, 29 May 2023 16:48:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8FMdFze7dGSNHwAAauVa8A (envelope-from ) for ; Mon, 29 May 2023 16:48:23 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3BC9628889 for ; Mon, 29 May 2023 16:48:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3e9M-000240-Du; Mon, 29 May 2023 10:47:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e9H-000221-24 for guix-patches@gnu.org; Mon, 29 May 2023 10:47:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3e9G-000331-Qe for guix-patches@gnu.org; Mon, 29 May 2023 10:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3e9G-0001Ol-Mn for guix-patches@gnu.org; Mon, 29 May 2023 10:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63571] [PATCH v2 05/19] import: json: Add #:timeout to 'json-fetch'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 May 2023 14:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63571 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63571@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63571-submit@debbugs.gnu.org id=B63571.16853715655189 (code B ref 63571); Mon, 29 May 2023 14:47:02 +0000 Received: (at 63571) by debbugs.gnu.org; 29 May 2023 14:46:05 +0000 Received: from localhost ([127.0.0.1]:58771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3e8L-0001LW-AG for submit@debbugs.gnu.org; Mon, 29 May 2023 10:46:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3e88-0001IE-E1 for 63571@debbugs.gnu.org; Mon, 29 May 2023 10:45:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e83-0002eA-3x; Mon, 29 May 2023 10:45:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=xLJLuPY/dTyxQSRRSJ+fiiUi/deSy30n6aZaQDZV5oc=; b=n+/ZkkiYaUWH+J8bJmuK XtXs9yvegsUozs1tRgo3T+Kyk64rvJXY5an80gUu0XFF8QwFSBHaWpdShxDR1Kq6vpJUzlBeGsaG6 dx+2MCSH9yyWGK0tJPE45VY/WhACpEgSuNb6aLDeCPoeSH49jYIFIJt2T/8ng5SCF9jjRjPAGZTMb drbYgnH4WYy/eBOFum67CM+V+JwYTNG3zUA2qHe183NQwZgk+joLj8Ju8f/UoRqNXqf8uerJJafIk B2MsgQpvrbnubyO1e6WZkJ5VdP6xgZ/EPBUuBxIoIurIxKeTJdZ2AYgEmrcWPnzoFD7VfCqMEZoB2 +3OF0wb4vCaI/w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e82-00044B-Cb; Mon, 29 May 2023 10:45:46 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 29 May 2023 16:45:16 +0200 Message-Id: <156b90a19e02ca481e2e6f775562d0da66aa773b.1685371175.git.ludo@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <87y1l7fb9j.fsf@gnu.org> References: <87y1l7fb9j.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685371703; a=rsa-sha256; cv=none; b=MuhzuIribc3SJ21D8/SmgTjm7Hsg7+HcnnacFi4P2perbDCrs5uABts8yoE7uS6E3Ok6pr 4pI10UzEVD0MPrxQoU9v6L2G4M5oDsVFXO4GsdspbJwoGXoQ5qZJnbE7GBOez01tvIGqPO RpV+SX9ImRAvEoD9/xW3SfdBP+bY42fK8wS09U8bZi9z42d/oKr6XccMN0+dU0LFMzPkjY 4NF1yKUsze9W1JE0/nLlU1zol/r/TYHjaiDRHfGycANOPRWf8HyJBwrrPgtdiqDV7F88CQ NfqTmIoZAgbcRSp2u9bYY9QF8mhEV+MA8kF9u8n2HKDWrLtcBV/MMbllY889wQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="n+/ZkkiY"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685371703; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xLJLuPY/dTyxQSRRSJ+fiiUi/deSy30n6aZaQDZV5oc=; b=MiTkzbnBJFGA0UXIp1dko+PzIn5hiXauATkiod0KiIoVQ+WZtLvzqD3hUZkJ9MXlZTAPK0 qPbDt31K/VB3ALBIHSmMI3TRNaaTHJvJ36AAOszwNDJsiqwvfaYjXW1m8CFHA2Ap/0lyn+ QlQ8chyhURbw/hRtZGby9MsrDg8aN1D2SStizcxDRzjAnBkAKFVicLcRbHYZ0mRDUeupFy XYk21uqmYOAd4kb8UAskkhRcsl07quRu5v3xAUoFHPrkeLKnkkSGFAsL3V/5jCEgsASQ+u xpP7+XB4AR6ch2Rq8++oAX27TkHm4NnQ5juJyoBZrE5xicwlIAn1ntAtaBD5mA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="n+/ZkkiY"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.05 X-Spam-Score: -3.05 X-Migadu-Queue-Id: 3BC9628889 X-TUID: zETO2iwd5hy+ * guix/import/json.scm (json-fetch): Add #:timeout and pass it to 'http-fetch'. --- guix/import/json.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/import/json.scm b/guix/import/json.scm index ae00ee929e..b87e9918c5 100644 --- a/guix/import/json.scm +++ b/guix/import/json.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 David Thompson ;;; Copyright © 2015, 2016 Eric Bavier -;;; Copyright © 2018, 2019 Ludovic Courtès +;;; Copyright © 2018, 2019, 2023 Ludovic Courtès ;;; Copyright © 2020 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. @@ -37,6 +37,7 @@ (define-module (guix import json) (define* (json-fetch url #:key (http-fetch http-fetch) + (timeout 10) ;; Note: many websites returns 403 if we omit a ;; 'User-Agent' header. (headers `((user-agent . "GNU Guile") @@ -50,7 +51,7 @@ (define* (json-fetch url (or (= 403 error) (= 404 error)))) #f)) - (let* ((port (http-fetch url #:headers headers)) + (let* ((port (http-fetch url #:timeout timeout #:headers headers)) (result (json->scm port))) (close-port port) result))) -- 2.40.1