From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 AJSqJbxBZmQSPQAASxT56A (envelope-from ) for ; Thu, 18 May 2023 17:18:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MM6lJLxBZmRq3AAAG6o9tA (envelope-from ) for ; Thu, 18 May 2023 17:18:20 +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 536F8C14D for ; Thu, 18 May 2023 17:18:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzfNq-0003pf-Bj; Thu, 18 May 2023 11:17:38 -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 1pzfNI-0003K3-18 for guix-patches@gnu.org; Thu, 18 May 2023 11:17:11 -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 1pzfNH-0001yP-PN for guix-patches@gnu.org; Thu, 18 May 2023 11:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzfNH-0005Tz-L8 for guix-patches@gnu.org; Thu, 18 May 2023 11:17:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63571] [PATCH 05/14] 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: Thu, 18 May 2023 15:17:03 +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.168442301420996 (code B ref 63571); Thu, 18 May 2023 15:17:03 +0000 Received: (at 63571) by debbugs.gnu.org; 18 May 2023 15:16:54 +0000 Received: from localhost ([127.0.0.1]:54122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzfN7-0005ST-Kt for submit@debbugs.gnu.org; Thu, 18 May 2023 11:16:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzfMw-0005QP-GF for 63571@debbugs.gnu.org; Thu, 18 May 2023 11:16:45 -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 1pzfMr-0001uw-A5; Thu, 18 May 2023 11:16:37 -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=FrGv1qRhuEEFV41c8/BQ iDahlPctHsuaOLNCHZrlR3Fe/hgABYHkTKEghBRmvlYCDPjNoSjW+JqhwNBuLtVqQNpOBTFMd17ba DO8sOVO+owQbDmNsAkmZYY9L98xT1PHt9S0OBLOaeF5a/TlxG3YBdll5jadXDclNsrkerqkLfPtA7 7cv2qj5nU3d96J/7SiTkTkRPWXtSt1Sil/O7DEFfLCFMRgQIwuSkoVClR7HXlre2wODuM2qcbm8hH 46xDvNquXcqMFkdQzYzBdqo61eolA0knKNV16X67zfBTn0xoCB+sHjCHwscFHYQaKKxBF4kRnVBUL vXKOS07VuCaU7g==; 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 1pzfMq-0007G6-TC; Thu, 18 May 2023 11:16:37 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 18 May 2023 17:16:13 +0200 Message-Id: <0aa7fa1673b00a47cfae4aed6d0fe409ab01eed2.1684421460.git.ludo@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; =?UTF-8?Q?charset=3D=1B[6~?= 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684423100; a=rsa-sha256; cv=none; b=aQM9rxl0MNtdhfWEzvP+r4sqY4vUDbV0hLLvBgbCuFu50I0vnan70bie69qJ+4cEzImOiP EUBwMqk4QsfnYnIB0kY1b9jMDI1p52XlRBp4bkdxWbIKE/dUA5NjefZkxjvMdau1DBbNi+ mhdC++SBc1I0wjB9FQBVUSMLyRAihR9uXvW4v6miNhhbPe93lUuaRUsaLwMMVOPb5SmFQB YimUTgYy8d8c6csb4UoOVlRUaerHKqQ64j5RVjPW0HY5BYFUR6oMuVKDX2wziYuQ0Nb544 QIS8alU6quDnftK1C2oG48q2a6AfkhT37Y52i/RgWqCT5aD/WYGE9Qpw98PwiQ== 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=FrGv1qRh; 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=1684423100; 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=Lr9jEJAqGoxerYLuuFnfqEn6fTzSOJBFjP0yCqj1LJWNn0eHX7RNQ7SxY2DQ7b9Gg8Bjes EXzcvuQ7y2Me4mm7sBYcxbOcC8nnMntzNsQcub5XFwSAh/QIuOcVW7RBEsTPJ19VBsgOz2 7DtCjh6LrH+MIY450xHA3gyQX/2PRYGMyj30S3apVPLGg+MGu+CUENu+JYGsjq0PspqJWm geJ/WGTWXsfJ8onjAfzjka/u2QzvD+NP18tV0jgRi8Ws9mkN5jCV9bU+tgfA8MBLQTZseL k7AwQqc/Lv5Zfm9ONeviJZ07nA5yPtdX+ZMfJkRapbcJWDajmwQNBg0eKHjBJw== X-Migadu-Spam-Score: -3.99 X-Spam-Score: -3.99 X-Migadu-Queue-Id: 536F8C14D X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FrGv1qRh; 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-TUID: GPHE33kMhJsL * 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