From patchwork Mon Sep 13 14:51:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CEBCC433FE for ; Mon, 13 Sep 2021 15:36:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71DEE6103B for ; Mon, 13 Sep 2021 15:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343506AbhIMPiH (ORCPT ); Mon, 13 Sep 2021 11:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbhIMPiC (ORCPT ); Mon, 13 Sep 2021 11:38:02 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 289CDC09B05A for ; Mon, 13 Sep 2021 07:51:36 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id u15so9092578wru.6 for ; Mon, 13 Sep 2021 07:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4zlGxnujYNmoQ4QrIPw0p8RsHcRlItr76ND9Bcg/8AM=; b=OSskH8+tpBqB819KlqHj7K4n536RPWSHIBjrVqU0PWfAxEheian/9Ema+lbqOFxJii /7if5O0UgI7e165MG3j9GQO6p7YGbLRLaNF7mtkkznwiCCyj/0jrxb5G75M0+KjPmzcZ w+xy9QXAKgCWCe76Psf+gJt3sIugyxMgvsjMM085kbOUnrA6KepZBMemdOLuJALqY8Cb 2yr25aKSko6U2evaX33D/YkPUVMdvrqG9YDJ2byUVkykoQ32RzQb4ybvK2KiP3hFCdSJ qlHDamUtVmkC3qZzCOUDW9oO6ThYuPqZzqbPl75D+3vb84zEbdK6mjiqNYj09KTBP4VT 47QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4zlGxnujYNmoQ4QrIPw0p8RsHcRlItr76ND9Bcg/8AM=; b=kdogROYvA/cB/8kbbyYmIZd0u20wJKl9S+8orPBXS5mVoZVAMrj/T/cVeRjAc3egds yA6LhUC9kI69bhczfaV8KpSwgvM2FwSJAguXF3vaQ+0ATu9lw5LDnxzSbbsCkWjPvm8b JQXedIs0ucxMidfWkR+rVu6mTpy57+/J8bYDVA7/RPZlmpQLYvc9Y29WNe3xnMJzWyxa DMfWGGCJO8ZVlHQsd0mnfDf1KQoHwJ1YYb+OPzLuhy1+wYT85tynkoVIzAb+G1BPflnG OYXoB56BEszvPAQ0zY8T2DLNqro1UyNbdu6g29QmXdtt0sEo3ykL0i6h8YLsz5b0A7R4 xrjw== X-Gm-Message-State: AOAM5316w6+BD7oxPHdHOzl0eT5Mvx1LQ2aI+gHjrVkPlZV1CobPYtso 7tq6e+veDKNxotxaYoykGyL1euHPhJu0Rw== X-Google-Smtp-Source: ABdhPJw7vyYt6A8vF4VVQTu3zTbGrt9GrmKAZyC8eBaqrej4CyMgVwKtaXP/PszTk3CfRtI8YBnGAw== X-Received: by 2002:a5d:5003:: with SMTP id e3mr13265249wrt.118.1631544694426; Mon, 13 Sep 2021 07:51:34 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:33 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 1/9] INSTALL: don't mention the "curl" executable at all Date: Mon, 13 Sep 2021 16:51:21 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In 1d53f90ed97 (The "curl" executable is no longer required, 2008-06-15) the wording for requiring curl(1) was changed to the current "you might also want...". Mentioning the "curl" executable at all is just confusing, someone building git might want to use it to debug things, but they might also just use wget(1) or some other http client. The "curl" executable has the advantage that you might be able to e.g. reproduce a bug in git's usage of libcurl with it, but anyone going to those extents is unlikely to be aided by this note in INSTALL. Signed-off-by: Ævar Arnfjörð Bjarmason --- INSTALL | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index 66389ce0591..5b8bd5ccce1 100644 --- a/INSTALL +++ b/INSTALL @@ -139,8 +139,7 @@ Issues of note: (PPC_SHA1). - "libcurl" library is used by git-http-fetch, git-fetch, and, if - the curl version >= 7.34.0, for git-imap-send. You might also - want the "curl" executable for debugging purposes. If you do not + the curl version >= 7.34.0, for git-imap-send. If you do not use http:// or https:// repositories, and do not want to put patches into an IMAP mailbox, you do not have to have them (use NO_CURL). From patchwork Mon Sep 13 14:51:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26AD6C433F5 for ; Mon, 13 Sep 2021 15:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10C2260F26 for ; Mon, 13 Sep 2021 15:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbhIMPiJ (ORCPT ); Mon, 13 Sep 2021 11:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242395AbhIMPiD (ORCPT ); Mon, 13 Sep 2021 11:38:03 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 487C4C020E74 for ; Mon, 13 Sep 2021 07:51:37 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id w29so14375947wra.8 for ; Mon, 13 Sep 2021 07:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B03ahexfe6TLmP0FL/ueG7or82rBukrg7Htb7qQQX9s=; b=TuGCyZjQBsAauPRiD2ledf09YMoq7zv7hkiOhj7KddoZrITgS263DJjEeJZUzNjjsw u2dJ8vSg9C7SH/KFAbaB4QLBYD6m544yz8C1v/ceujbXekoNyu+TyqNjdc1A9p+P4deW W5b7QFT/Id0+6Nlk4+3vzQIXl5dlSZuI8Wc/U091Jz1oNpXZLzzf8r08H9QhPX5QQGFu Ycg+8XdIeuB58kolMc+ZrfVXZZ4N8JQ+CbRnejCOY/PnmOYNAABxLChSLog24mO8KGq7 ql8gK1pVdp6mcMHG1NHrNhzrvIB7tPW0X2oTmZAdmnmdJDwoS9Jt81Zqtq35Z3cwrEYs x8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B03ahexfe6TLmP0FL/ueG7or82rBukrg7Htb7qQQX9s=; b=7AX70vzXwfBvajzuVVz2hIh8x/L1b4r9m0iywdD0EfzjHfBqKD4kZuMnRy6CJUc//T wo3kvvPpy4qPP+aJDNRVR9eBaGOLPdsCfEENThMjgwigPrWXH+xKG7TpUWbjlMrqAH77 MhYKQQzSfI3zm/nnqUCsDaOoGIRsiiA+Kv1nhY/s2/hwVXKFMKsW3K095wiRTDvCrNnN 5NXZD/l8VhB7yc1hNTdu9T3KWVljGX9YvoLQawSd4XDihC60yWqLLoCEHJUPwRSZ/8Kn YDAMTfcNnSKc6wmG/E32WIV2S81wJfDxvdfweXlFCmDudPCEJzbUXYGma50FIbJfSNbx pwqw== X-Gm-Message-State: AOAM531fQvtzDjxorsx8VXqAMuX1Bk7vPUH+C8rfKUMEC+Xx4TDhH0Lk H2l/FehqK169a+2j011nNK7a67zE8Wd8Wg== X-Google-Smtp-Source: ABdhPJwPpy7JiQZ8Nqab+S21eU+ghwj9IjCTHiSgTWd/f4CM1+XWrSO8TAz/LwhqIpiir7U3LA8JeQ== X-Received: by 2002:a5d:4285:: with SMTP id k5mr13389317wrq.131.1631544695635; Mon, 13 Sep 2021 07:51:35 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:35 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 2/9] INSTALL: reword and copy-edit the "libcurl" section Date: Mon, 13 Sep 2021 16:51:22 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Make the "libcurl" section shorter and more to the point, this is mostly based on suggestions from [1]. 1. https://lore.kernel.org/git/YTtxcBdF2VQdWp5C@coredump.intra.peff.net/ Signed-off-by: Ævar Arnfjörð Bjarmason --- INSTALL | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL b/INSTALL index 5b8bd5ccce1..d593f628749 100644 --- a/INSTALL +++ b/INSTALL @@ -138,11 +138,11 @@ Issues of note: BLK_SHA1. Also included is a version optimized for PowerPC (PPC_SHA1). - - "libcurl" library is used by git-http-fetch, git-fetch, and, if - the curl version >= 7.34.0, for git-imap-send. If you do not - use http:// or https:// repositories, and do not want to put - patches into an IMAP mailbox, you do not have to have them - (use NO_CURL). + - "libcurl" library is used for fetching and pushing + repositories over http:// or https://, as well as by + git-imap-send if the curl version is >= 7.34.0. If you do + not need that functionality, use NO_CURL to build without + it. - "expat" library; git-http-push uses it for remote lock management over DAV. Similar to "curl" above, this is optional From patchwork Mon Sep 13 14:51:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD233C433EF for ; Mon, 13 Sep 2021 15:36:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2F3B60249 for ; Mon, 13 Sep 2021 15:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241842AbhIMPiK (ORCPT ); Mon, 13 Sep 2021 11:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242449AbhIMPiD (ORCPT ); Mon, 13 Sep 2021 11:38:03 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58886C020E77 for ; Mon, 13 Sep 2021 07:51:38 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id x6so15121209wrv.13 for ; Mon, 13 Sep 2021 07:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IEBhoXA/uCuYxHAulEbX7IBD6MgsDIgoj9dNJJdhBmE=; b=gFjq+4OCcNxK1hEDl/IAmqQCsaxxmz1gLshBJuhzD88IOV8ffPIUEpHWmZkhORt6Ly /1O5v0iDgcdirjxDwXnHKvVag15gPHaemLd/MA0DBC80Hfv6Ocvo7owwfa0gy2NaCe5O Kj0/PxW8G+ZIhtJlZp/rYcirqKyBxwO20I2wjpWIW+R2Co3uFP5xY9yl2SMHTmxC+Yq9 4TQyDsVjtWVCKkm5+bw+AytNihl++lH/kVezvK+3CHOeogxJQ79Fl6jFuhMIbBmM47PZ fNHxXOQAE3X+R3R9VNy0rCKrp7Ayj666ncvcIL0lN+2hQC0vl1taVVXO6Kz+eIxS9F7T fPkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IEBhoXA/uCuYxHAulEbX7IBD6MgsDIgoj9dNJJdhBmE=; b=Cs1P2uwEDVobrMS4lNar18y6Ixwz/NrFFP1y6mqWGa+Sw/ruzaAOaMnkBiDzeTechN 5nN/RDa5WdrZOfWOTDtmdv30RBxE6MB/e8s12/1lVMyY0mDc7+gVjU2k720F8/JzSLMN edp4o8vWHY30NXHuVi2g54th/uWSSu/NVza06Y1h4MGmjdj+bQUkTob0Q2xOUxR0i64a gq6b8FHty253olbjQPfzDVHy5AvtFzYqFp42HkqTE+LY0rm6GtlW7KmUEViSXCPGbOZz b7LEwuxJ2nwn+cphvqMu96uJXpcboKY+NXNMa7av0FyaQZxCgNlumbAPUVlS37ga5Hu3 cvwQ== X-Gm-Message-State: AOAM532/opbavG4wWa7bwpa9B9eYaCn6vY0bECNY72S8KK0CBIyVHrD8 LHMoigSizx6nPBKaGIOyqsupLrr7Z8nEZw== X-Google-Smtp-Source: ABdhPJxfyo6nLwN2Xf1wTllpc3Hqo9a9TWK1Hi7hzBiZcIrrHVlZD4HoE3fS09FLjzUdfkNTpigGDg== X-Received: by 2002:adf:db4a:: with SMTP id f10mr3884840wrj.91.1631544696671; Mon, 13 Sep 2021 07:51:36 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:36 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 3/9] INSTALL: mention that we need libcurl 7.19.4 or newer to build Date: Mon, 13 Sep 2021 16:51:23 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Without NO_CURL=Y we require at least version "7.19.4" of libcurl, see 644de29e220 (http: drop support for curl < 7.19.4, 2021-07-30). Let's document this in the "INSTALL" document. Signed-off-by: Ævar Arnfjörð Bjarmason --- INSTALL | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/INSTALL b/INSTALL index d593f628749..4140a3f5c8b 100644 --- a/INSTALL +++ b/INSTALL @@ -144,6 +144,10 @@ Issues of note: not need that functionality, use NO_CURL to build without it. + Git requires version "7.19.4" or later of "libcurl" to build + without NO_CURL. This version requirement may be bumped in + the future. + - "expat" library; git-http-push uses it for remote lock management over DAV. Similar to "curl" above, this is optional (with NO_EXPAT). From patchwork Mon Sep 13 14:51:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EC99C433FE for ; Mon, 13 Sep 2021 15:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D9FB60249 for ; Mon, 13 Sep 2021 15:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244296AbhIMPiQ (ORCPT ); Mon, 13 Sep 2021 11:38:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243017AbhIMPiE (ORCPT ); Mon, 13 Sep 2021 11:38:04 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CB9DC020E79 for ; Mon, 13 Sep 2021 07:51:39 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id t8so10110767wrq.4 for ; Mon, 13 Sep 2021 07:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OYQ3u3y0aqBXRCQJhJY4sT0NBMqrrZoDEk1VGU9rFT8=; b=DmhBfJetC0lCJnwvtrV1eCX+4/er7MD/mkmmnNHKlu6aSYpFO/CzWn6tX0nMICirlB JkdnryRW4A+s9docQa6VGw3L+Tjb9fy7ImflOkFn5lwkzEodXDGiTponxnfyXNVaeZ8T ABGaegQ5p8CQbrr9tkKpAxrkm/1K979cmGrdH5qXPsPvitIuxspn3f7+x1p7f+7HTC87 ikofCDdNEWhtRZ3yOTfjj4OcEQhBgIzuGOt+AIpncu1leX0OplGfgam4BSZ4ftkGyG5o x2TBatdKf7+8MxqTVbNe9aog/hxSITZAr8UCotCUk6vfN0jotqLHJebYMCnXRssiZ0Bs NrRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OYQ3u3y0aqBXRCQJhJY4sT0NBMqrrZoDEk1VGU9rFT8=; b=pd+k0ymCOvYDldHVP7FsZXQjNVUKOuEC1Qt20NPxv7WwPNnTChW306ySDH2NPj5UuJ ruCmHW2N/EVKyqUy/BQJQdpwChoZLrXyHzjYpVt3z08/hWy7kmoMKc8P3VIiDNeeCpNT ftEmb5e/M2lr6CrMtreBe8CcexXIFe2YxjUJPxc9Dyh/zoALbWhiAZJWoXGKyz9CE8m0 5HqZ4U49BFGuzsGXF6+i3/KCYXdcRKPyyXXIpMdzEG1pDLDQLJwLdZwU1aO7GK2I7g+1 s6trgrk1kSdYLEC1gg3BJ9ZZA63MZh0GvGX2mit+bzojSFaFQwDkZ92/jC7ah8/D3zyH gjuQ== X-Gm-Message-State: AOAM532HDKTbioWPUKzpmWRYWFAVOL8XYhyG4fsHEfQVenl/dqmCunVD 80Clmh0+9033TBYQ+Rm1LDhtyN6E2Nvu6g== X-Google-Smtp-Source: ABdhPJzrRDDAmIsJo2WwtU7SCKi76rCIvrkixRhRWGZQ3GikX8qPZPXOB754GKoFX/Ny4RYofaEixQ== X-Received: by 2002:a5d:44c8:: with SMTP id z8mr12747336wrr.332.1631544697783; Mon, 13 Sep 2021 07:51:37 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:37 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 4/9] Makefile: drop support for curl < 7.9.8 (again) Date: Mon, 13 Sep 2021 16:51:24 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In 1119a15b5c8 (http: drop support for curl < 7.11.1, 2021-07-30) support for curl versions older than 7.11.1 was removed, and we currently require at least version 7.19.4, see 644de29e220 (http: drop support for curl < 7.19.4, 2021-07-30). In those changes this Makefile-specific check added in 0890098780f (Decide whether to build http-push in the Makefile, 2005-11-18) was missed, now that we're never going to use such an ancient curl version we don't need to check that we have at least 7.9.8 here. I have no idea what in http-push.c broke on versions older than that. This does not impact "NO_CURL" setups, as this is in the "else" branch after that check. Signed-off-by: Ævar Arnfjörð Bjarmason --- Makefile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 429c276058d..378f58b950d 100644 --- a/Makefile +++ b/Makefile @@ -1436,15 +1436,8 @@ else REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES) PROGRAM_OBJS += http-fetch.o PROGRAMS += $(REMOTE_CURL_NAMES) - curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p) - ifeq "$(curl_check)" "070908" - ifndef NO_EXPAT - PROGRAM_OBJS += http-push.o - else - EXCLUDED_PROGRAMS += git-http-push - endif - else - EXCLUDED_PROGRAMS += git-http-push + ifndef NO_EXPAT + PROGRAM_OBJS += http-push.o endif curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p) ifeq "$(curl_check)" "072200" From patchwork Mon Sep 13 14:51:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 413C2C433EF for ; Mon, 13 Sep 2021 15:37:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22F8460249 for ; Mon, 13 Sep 2021 15:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244873AbhIMPiR (ORCPT ); Mon, 13 Sep 2021 11:38:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240371AbhIMPiE (ORCPT ); Mon, 13 Sep 2021 11:38:04 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F61C020E7B for ; Mon, 13 Sep 2021 07:51:40 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so166147wms.4 for ; Mon, 13 Sep 2021 07:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bA1Yc88YPUYOuVpDAWHt4mfj96aq/dryPQCy1gAylLI=; b=FDoo9EFEB8y3eyFVxg89Cbi93WDxzwuKTnuSzSj3kOqZzF+lA5iyHR8CXhDqUJGib2 zGxlUb9//5WsBc049wBpt/fQr6T+OHigPODHD9Lg+tiNTUR1/ywFI5sxWBSDV5pmtOVt iK026XdUZIucmINOMY2HZxcl9Ifd/1Zfp1ck8zM3BqorinHNaYXAK6LKrJ4eUK1M3gM6 5hHYEpqAJk/nswAftFRbycLhnb6Aj7iCt7aR+SYinHkJHofy4ssYFF9vDT0lRXiWCVQZ 2vrll+QG2N+cJc8jIpSNzCKeKQbCzKbvlld03vR7OZ71J6YjTG4KSBV+wS9veZ26S9YM wSxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bA1Yc88YPUYOuVpDAWHt4mfj96aq/dryPQCy1gAylLI=; b=oyTf/8PJTNv2C8wWHj0NJTEiuN9ooY03aDML6aIKa6fYdhUi2hpuliuaATUlkZYV4N xCKISqQ+zoEiGtd1BnX/YZ809zOitcCl+fpRAyKV2nBuEcsMFVj5EJ3UHVsugDBzUeVi C/sC8FgKlx9VV+yZMl1HNPRkLQmMIY1aPpcY1VimCt0mkPhqF7aTFQVYvI4tSsBDrc1+ M8V9FO6Vx36Ypf0LLWZ//g6oZLRW7w0fY0KcSM3SRBVnAjVofLj0etQ+v4sDBi1Mc2n6 z8xgapvCACnvU/kzI6Aw16pGfMEhNCvpAkvUwhCIxYz6A+f7xsOrNJzv9PLdtapN3lbh Ss7Q== X-Gm-Message-State: AOAM533/WFBykky/7bw8SJ0GbIigIt4bmcs8oAN+0zcWcaRfAKqvj5wB cQ3gVhDo6CkwrtGr/snq4IviCHtbPa9vyQ== X-Google-Smtp-Source: ABdhPJzduuZ/jTiqe0XQxLOD8UOduVdBvES1b6CcGcmI5LSLUpgrdlmBDeP8IdZLYBwTHXFgvO9Nfw== X-Received: by 2002:a1c:a713:: with SMTP id q19mr11635663wme.42.1631544699140; Mon, 13 Sep 2021 07:51:39 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:38 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 5/9] http: drop support for curl < 7.18.0 (again) Date: Mon, 13 Sep 2021 16:51:25 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In 644de29e220 (http: drop support for curl < 7.19.4, 2021-07-30) we dropped support for curl < 7.19.4, so we can drop support for this non-obvious dependency on curl < 7.18.0. It's non-obvious because in curl's hex version notation 0x071800 is version 7.24.0, *not* 7.18.0, so at a glance this patch looks incorrect. But it's correct, because the existing version check being removed here is wrong. The check guards use of the following curl defines: CURLPROXY_SOCKS4 7.10 CURLPROXY_SOCKS4A 7.18.0 CURLPROXY_SOCKS5 7.10 CURLPROXY_SOCKS5_HOSTNAME 7.18.0 I.e. the oldest version that has these is in fact 7.18.0, not 7.24.0. That we were checking 7.24.0 is just an mistake in 6d7afe07f29 (remote-http(s): support SOCKS proxies, 2015-10-26), i.e. its author confusing base 10 and base 16. Signed-off-by: Ævar Arnfjörð Bjarmason --- http.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/http.c b/http.c index a0f169d2fe5..56856178bfe 100644 --- a/http.c +++ b/http.c @@ -927,7 +927,6 @@ static CURL *get_curl_handle(void) */ curl_easy_setopt(result, CURLOPT_PROXY, ""); } else if (curl_http_proxy) { -#if LIBCURL_VERSION_NUM >= 0x071800 if (starts_with(curl_http_proxy, "socks5h")) curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); @@ -940,7 +939,6 @@ static CURL *get_curl_handle(void) else if (starts_with(curl_http_proxy, "socks")) curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); -#endif #if LIBCURL_VERSION_NUM >= 0x073400 else if (starts_with(curl_http_proxy, "https")) { curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS); From patchwork Mon Sep 13 14:51:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FA7CC433EF for ; Mon, 13 Sep 2021 15:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A76260249 for ; Mon, 13 Sep 2021 15:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243941AbhIMPiN (ORCPT ); Mon, 13 Sep 2021 11:38:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245133AbhIMPiE (ORCPT ); Mon, 13 Sep 2021 11:38:04 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AD4EC020E7C for ; Mon, 13 Sep 2021 07:51:42 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id i3so6883207wmq.3 for ; Mon, 13 Sep 2021 07:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/iD6WqRQz8S7xYRDkESMQlS+tH4246i9fKxOHUyasTA=; b=f3Cvew+erqdLHLXuNDsl5u846icz2PEeIBkgYPPRy8rsEH0dFigdwalJwoRtSuKuks RE2vDUQbEy+7lv1yKygWyZrpo/8BgGi0+lx3IonqqS7rtY97RvfsKWEzZWWK3V9xo6/U Co2Z6BYT4bbzKHP8BK3VVkPiPwVjO20U8NsYExqv5sS5ls32fH+87ewDmkO3VYAgENAM +3H2wRXIs5vkI4VscARMoQHl8+cqdLQVyCiOIZKUF7NNBJwe1RIOFzFu065eqEVY2r20 8TlSD/BXLNaObteAdQAnw+Dw71gKKHG+hzcGqIzq+GmruvgeR85HP5Yk4tZ8+E7pPUot /IPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/iD6WqRQz8S7xYRDkESMQlS+tH4246i9fKxOHUyasTA=; b=4NuKSARMcG2tvV7AMPvYBgDtT8IFL8pUdgaF4AAgSPbzacmp2dITJZLSDADz1bzYsa S4cb8/ypHSlwP3kwF+vUC2oQDslteCJwHeU86XCpkjcRvfXBUJVSmxNRAP2cDb10u/+p 8VyzSO2/PffR1LqanG4Qsb6SLf2g+9OW6vthLkxbDtsk+ZVjRvlwCus4zsosyWp4OL9c l2JUWRWmeRNFlQGvWC5rI6gm021Pa9fB4xSLwe4FEwBhETD5xf0NwM65LY5xLmXb5Yt8 dB9DDTsOqw4UoDzW8OSRi/P5KR3iv+xcxviuwI2A/Atr9T0d+1NmkZ0xVGiNgSRedWVB daaw== X-Gm-Message-State: AOAM532sN+KU9gUtxCV1LqOjGR038jksMuEhH7uBhEE369kEVN240NRC Xzly6k8Rwv02H0OsW7uH0OaLhNGXcCe+Vw== X-Google-Smtp-Source: ABdhPJyXR+gxa4RLP8QYyxgQZ7CmIGl3u1rqrgFudiROIw6hpfnJ6ko9tfwGwJmIbhG1wd3i5zrMyQ== X-Received: by 2002:a05:600c:4ba2:: with SMTP id e34mr11917302wmp.50.1631544700287; Mon, 13 Sep 2021 07:51:40 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:39 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 6/9] http: correct version check for CURL_HTTP_VERSION_2 Date: Mon, 13 Sep 2021 16:51:26 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In d73019feb44 (http: add support selecting http version, 2018-11-08) a dependency was added on CURL_HTTP_VERSION_2, but this feature was introduced in curl version 7.43.0, not 7.47.0, as the incorrect version check led us to believe. As looking through the history of that commit on the mailing list will reveal[1], the reason for this is that an earlier version of it depended on CURL_HTTP_VERSION_2TLS, which was introduced in libcurl 7.47.0. But the version that made it in in d73019feb44 had dropped the dependency on CURL_HTTP_VERSION_2TLS, but the corresponding version check was not corrected. The newest symbol we depend on is CURL_HTTP_VERSION_2. It was added in 7.33.0, but the CURL_HTTP_VERSION_2 alias we used was added in 7.47.0. So we could support an even older version here, but let's just correct the checked version. 1. https://lore.kernel.org/git/pull.69.git.gitgitgadget@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason --- http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index 56856178bfe..b82b5b7a532 100644 --- a/http.c +++ b/http.c @@ -732,7 +732,7 @@ static long get_curl_allowed_protocols(int from_user) return allowed_protocols; } -#if LIBCURL_VERSION_NUM >=0x072f00 +#if LIBCURL_VERSION_NUM >=0x072b00 static int get_curl_http_version_opt(const char *version_string, long *opt) { int i; @@ -774,7 +774,7 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2); } -#if LIBCURL_VERSION_NUM >= 0x072f00 // 7.47.0 +#if LIBCURL_VERSION_NUM >= 0x072b00 if (curl_http_version) { long opt; if (!get_curl_http_version_opt(curl_http_version, &opt)) { From patchwork Mon Sep 13 14:51:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B64B6C433FE for ; Mon, 13 Sep 2021 15:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0A5A60249 for ; Mon, 13 Sep 2021 15:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241525AbhIMPiM (ORCPT ); Mon, 13 Sep 2021 11:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235050AbhIMPiE (ORCPT ); Mon, 13 Sep 2021 11:38:04 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03A90C020E7D for ; Mon, 13 Sep 2021 07:51:43 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id u16so15148509wrn.5 for ; Mon, 13 Sep 2021 07:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DMUtiS4Lhx7VGgQLSJW5yNJ36WytHsRs5vDzmXhu+kc=; b=jEyEm1ABkdv6A35eYj4yoEf07eng5vMN8DaHzWA7VjK56m0BHAF3mvh17dmItFym0B ++upmkLI/8Ye7oLBuaOLx+fQ+S2DA3V9MV59jz3CWyM4QMWRhBduHTlgK7Kv1FlShQeR P4bm0R80E44AhYZlZKx8qp6nXO9zPCZ+jarm/Vv3TY8oyFOLokC2gAPgXbA8XZ9ggA2x Bu4JPibYxtaHKqownTg75Ig69Kr9u1RVAyn2AYUGZsSbiaTMkkxOe1fnOU5QTpEzZQR7 GRmGcRGe37QvCabkoAwp7VrOdG9HDifIrgkALLQpe8w6/CGQ0Jlf5M/8NdwWkMwOiNj3 n4Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DMUtiS4Lhx7VGgQLSJW5yNJ36WytHsRs5vDzmXhu+kc=; b=Y7iJkcwPFQsGcXILYk5MStkZ93EGOvIN+B/9ZO7QY2HEJJ5le/tE//ND4KPDNTKyAN 9yx1Ur0tg9qouvrHf/c+hU1+xPMi6O/uTcu0/GZscCo23w1f10HPCv47JB4w2V5IDkDF EVOtz2lh9bKKYxnUqKMCGnD9tNfTserNV7WYuzTJ0hPLJy4Z65spiO3XJPqW8U2TfhcV lt96f2mf/CC0TI2PbkQ17c4O4E1womo2+QyWVKLFjLEXEDb/1RnTOyM94rurjcJUdbmY 3rY4FQNoJ5hMJP5HfryI5kVUnFCD9eoqbzg+2UxHKot9j46vRXKpBOwpPGjkgSTHOxoJ c15w== X-Gm-Message-State: AOAM531+SDpeWhmbzruu1Fb5tzhbwdeH7OED6Nee/If4LMrtOJ+vWYlu 1oL6cJOsKo58Luo3h1KhEfl3heDNG96l+A== X-Google-Smtp-Source: ABdhPJyZ0123/AWB2+2msjE3TD3BCPzvY2k6h6wJhPwhu/+2cTAAYxGAHFmVgiqh6NF7m9XcdIYisA== X-Received: by 2002:a05:6000:46:: with SMTP id k6mr5863896wrx.104.1631544701324; Mon, 13 Sep 2021 07:51:41 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:40 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 7/9] http: correct curl version check for CURLOPT_PINNEDPUBLICKEY Date: Mon, 13 Sep 2021 16:51:27 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In aeff8a61216 (http: implement public key pinning, 2016-02-15) a dependency and warning() was added if curl older than 7.44.0 was used, but the relevant code depended on CURLOPT_PINNEDPUBLICKEY, introduced in 7.39.0. Signed-off-by: Ævar Arnfjörð Bjarmason --- http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/http.c b/http.c index b82b5b7a532..543faad9879 100644 --- a/http.c +++ b/http.c @@ -59,7 +59,7 @@ static struct { static const char *ssl_key; static const char *ssl_capath; static const char *curl_no_proxy; -#if LIBCURL_VERSION_NUM >= 0x072c00 +#if LIBCURL_VERSION_NUM >= 0x072700 static const char *ssl_pinnedkey; #endif static const char *ssl_cainfo; @@ -373,10 +373,10 @@ static int http_options(const char *var, const char *value, void *cb) } if (!strcmp("http.pinnedpubkey", var)) { -#if LIBCURL_VERSION_NUM >= 0x072c00 +#if LIBCURL_VERSION_NUM >= 0x072700 return git_config_pathname(&ssl_pinnedkey, var, value); #else - warning(_("Public key pinning not supported with cURL < 7.44.0")); + warning(_("Public key pinning not supported with cURL < 7.39.0")); return 0; #endif } @@ -845,7 +845,7 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key); if (ssl_capath != NULL) curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath); -#if LIBCURL_VERSION_NUM >= 0x072c00 +#if LIBCURL_VERSION_NUM >= 0x072700 if (ssl_pinnedkey != NULL) curl_easy_setopt(result, CURLOPT_PINNEDPUBLICKEY, ssl_pinnedkey); #endif From patchwork Mon Sep 13 14:51:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAF80C433FE for ; Mon, 13 Sep 2021 15:37:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B389B6103B for ; Mon, 13 Sep 2021 15:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241092AbhIMPiS (ORCPT ); Mon, 13 Sep 2021 11:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241239AbhIMPiE (ORCPT ); Mon, 13 Sep 2021 11:38:04 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67289C020E7E for ; Mon, 13 Sep 2021 07:51:44 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id u16so15148608wrn.5 for ; Mon, 13 Sep 2021 07:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NxvopZ6QZexJAttXmIm1JFZXyz1dCpjeWh6jD+v17F8=; b=Vs5Y6mL+KMteo5N5OiCstzN4C3LaL6wIPeUrI3qS9WWvBHDIi90Oc6hkoyzWXs+L0B C1N1aHztvp4lYL9V6P2GtlXcye98ZvmSVhN+laV2dHiMIvU6vBwhms5dW30qPuPZA/aw eFXGJXuC2bgvAB+7juXFInVcq1mWIJmgjRH1cfqujX5uQAjZ2mqnVDFIlPlMmFd/t0Qh nu0dkK0coQV82KTz+Bi0WLOorzB8LCGMXqQBuPU/ibG7Hd+lt4n6cgDb/GJZ0iJoinNK RmijsRIJ9FoQCz0Zph4K+TStP0AveUiziXaabtfjK0Fw3hWSdyH+GEfBym6Z3tZPUj+W F4cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxvopZ6QZexJAttXmIm1JFZXyz1dCpjeWh6jD+v17F8=; b=iPD5b2vI+1vCopR/sKQ04Gs2EB6S/IjF0twwGRtSh5FdFnVJKQ1FzGflK7RUIaJ4kP wO6qN/XA8jbZ6/z7EX4DNjdkPttNKBPa5A6Y1DP53kaLnyvJDPb2LXURpQ1dlZThRcNw IF/cNEMxAJgiiwTTq/CBl6c+zq7m16iCXRbcGj0cB25RFuiJM+Ud3xtCx6LR+6XNWFRh 24cAk77J65E8Fnewf5xwY/TlJ2ciL2CXZN+xxeadKVyYCStnT+hPPuiVUV779UNa4wAp cwFVIVyg+Rv/7E67ae6lrZAbBuSHrReOvoYU2CeIDLceWU6nvWiUw7WcgAC9N3on5yrt rlPw== X-Gm-Message-State: AOAM531/ytYHpUqG2cbONHDpYbqtfqN/AiKSyBO2uQPjylieUuBvQxLB 7kTjWzwIruFGy39ya0s0DTf5lDStGoomcg== X-Google-Smtp-Source: ABdhPJxSuKfGztdLtOQnvMOu6Kd5A1ZhhwHl7/n0nWiPyQmoXRs6kb2QSP2fPRoyUPxpZ8M8yS5CZA== X-Received: by 2002:a5d:5003:: with SMTP id e3mr13265840wrt.118.1631544702541; Mon, 13 Sep 2021 07:51:42 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:41 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 8/9] http: centralize the accounting of libcurl dependencies Date: Mon, 13 Sep 2021 16:51:28 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org As discussed in 644de29e220 (http: drop support for curl < 7.19.4, 2021-07-30) checking against LIBCURL_VERSION_NUM isn't as reliable as checking specific symbols present in curl, as some distros have been known to backport features. However, while some of the curl_easy_setopt() arguments we rely on are macros, others are enum, and we can't assume that those that are macros won't change into enums in the future. So we're still going to have to check LIBCURL_VERSION_NUM, but by doing that in one central place and using a macro definition of our own, anyone who's backporting features can define it themselves, and thus have access to more modern curl features that they backported, even if they didn't bump the LIBCURL_VERSION_NUM. More importantly, as shown in a preceding commit doing these version checks makes for hard to read and possibly buggy code, as shown by the bug fixed there where we were conflating base 10 for base 16 when comparing the version. By doing them all in one place we'll hopefully reduce the chances of such future mistakes, furthermore it now becomes easier to see at a glance what the oldest supported version is, which makes it easier to reason about any future deprecation similar to the recent e48a623dea0 (Merge branch 'ab/http-drop-old-curl', 2021-08-24). Signed-off-by: Ævar Arnfjörð Bjarmason --- git-curl-compat.h | 117 ++++++++++++++++++++++++++++++++++++++++++++++ http.c | 29 ++++++------ imap-send.c | 2 +- 3 files changed, 133 insertions(+), 15 deletions(-) create mode 100644 git-curl-compat.h diff --git a/git-curl-compat.h b/git-curl-compat.h new file mode 100644 index 00000000000..7ad87e89ed5 --- /dev/null +++ b/git-curl-compat.h @@ -0,0 +1,117 @@ +#ifndef GIT_CURL_COMPAT_H +#define GIT_CURL_COMPAT_H +#include + +/** + * This header centralizes the declaration of our libcurl dependencies + * to make it easy to discover the oldest versions we support, and to + * inform decisions about removing support for older libcurl in the + * future. + * + * The oldest supported version of curl is documented in the "INSTALL" + * document. + * + * The source of truth for what versions have which symbols is + * https://github.com/curl/curl/blob/master/docs/libcurl/symbols-in-versions; + * the release dates are taken from curl.git (at + * https://github.com/curl/curl/). + * + * For each X symbol we need from curl we define our own + * GIT_CURL_HAVE_X. If multiple similar symbols with the same prefix + * were defined in the same version we pick one and check for that name. + * + * Keep any symbols in date order of when their support was + * introduced, oldest first, in the official version of cURL library. + */ + +/** + * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012. + */ +#if LIBCURL_VERSION_NUM >= 0x071900 +#define GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE 1 +#endif + + +/** + * CURLOPT_LOGIN_OPTIONS was added in 7.34.0, released in December + * 2013. + * + * If we start requiring 7.34.0 we might also be able to remove the + * code conditional on USE_CURL_FOR_IMAP_SEND in imap-send.c, see + * 1e16b255b95 (git-imap-send: use libcurl for implementation, + * 2014-11-09) and the check it added for "072200" in the Makefile. + + */ +#if LIBCURL_VERSION_NUM >= 0x072200 +#define GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS 1 +#endif + +/** + * CURL_SSLVERSION_TLSv1_[012] was added in 7.34.0, released in + * December 2013. + */ +#if LIBCURL_VERSION_NUM >= 0x072200 +#define GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_0 +#endif + +/** + * CURLOPT_PINNEDPUBLICKEY was added in 7.39.0, released in November + * 2014. + */ +#if LIBCURL_VERSION_NUM >= 0x072c00 +#define GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY 1 +#endif + +/** + * CURL_HTTP_VERSION_2 was added in 7.43.0, released in June 2015. + * + * The CURL_HTTP_VERSION_2 alias (but not CURL_HTTP_VERSION_2_0) has + * always been a macro, not an enum field (checked on curl version + * 7.78.0) + */ +#if LIBCURL_VERSION_NUM >= 0x072b00 +#define GIT_CURL_HAVE_CURL_HTTP_VERSION_2 1 +#endif + +/** + * CURLSSLOPT_NO_REVOKE was added in 7.44.0, released in August 2015. + * + * The CURLSSLOPT_NO_REVOKE is, has always been a macro, not an enum + * field (checked on curl version 7.78.0) + */ +#if LIBCURL_VERSION_NUM >= 0x072c00 +#define GIT_CURL_HAVE_CURLSSLOPT_NO_REVOKE 1 +#endif + +/** + * CURLOPT_PROXY_CAINFO was added in 7.52.0, released in August 2017. + */ +#if LIBCURL_VERSION_NUM >= 0x073400 +#define GIT_CURL_HAVE_CURLOPT_PROXY_CAINFO 1 +#endif + +/** + * CURLOPT_PROXY_{KEYPASSWD,SSLCERT,SSLKEY} was added in 7.52.0, + * released in August 2017. + */ +#if LIBCURL_VERSION_NUM >= 0x073400 +#define GIT_CURL_HAVE_CURLOPT_PROXY_KEYPASSWD 1 +#endif + +/** + * CURL_SSLVERSION_TLSv1_3 was added in 7.53.0, released in February + * 2017. + */ +#if LIBCURL_VERSION_NUM >= 0x073400 +#define GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_3 1 +#endif + +/** + * CURLSSLSET_{NO_BACKENDS,OK,TOO_LATE,UNKNOWN_BACKEND} were added in + * 7.56.0, released in September 2017. + */ +#if LIBCURL_VERSION_NUM >= 0x073800 +#define GIT_CURL_HAVE_CURLSSLSET_NO_BACKENDS +#endif + +#endif diff --git a/http.c b/http.c index 543faad9879..94eefe97089 100644 --- a/http.c +++ b/http.c @@ -1,4 +1,5 @@ #include "git-compat-util.h" +#include "git-curl-compat.h" #include "http.h" #include "config.h" #include "pack.h" @@ -47,19 +48,19 @@ static struct { { "sslv2", CURL_SSLVERSION_SSLv2 }, { "sslv3", CURL_SSLVERSION_SSLv3 }, { "tlsv1", CURL_SSLVERSION_TLSv1 }, -#if LIBCURL_VERSION_NUM >= 0x072200 +#ifdef GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_0 { "tlsv1.0", CURL_SSLVERSION_TLSv1_0 }, { "tlsv1.1", CURL_SSLVERSION_TLSv1_1 }, { "tlsv1.2", CURL_SSLVERSION_TLSv1_2 }, #endif -#if LIBCURL_VERSION_NUM >= 0x073400 +#ifdef GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_3 { "tlsv1.3", CURL_SSLVERSION_TLSv1_3 }, #endif }; static const char *ssl_key; static const char *ssl_capath; static const char *curl_no_proxy; -#if LIBCURL_VERSION_NUM >= 0x072700 +#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY static const char *ssl_pinnedkey; #endif static const char *ssl_cainfo; @@ -373,7 +374,7 @@ static int http_options(const char *var, const char *value, void *cb) } if (!strcmp("http.pinnedpubkey", var)) { -#if LIBCURL_VERSION_NUM >= 0x072700 +#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY return git_config_pathname(&ssl_pinnedkey, var, value); #else warning(_("Public key pinning not supported with cURL < 7.39.0")); @@ -500,7 +501,7 @@ static int has_cert_password(void) return 1; } -#if LIBCURL_VERSION_NUM >= 0x073400 +#ifdef GIT_CURL_HAVE_CURLOPT_PROXY_KEYPASSWD static int has_proxy_cert_password(void) { if (http_proxy_ssl_cert == NULL || proxy_ssl_cert_password_required != 1) @@ -516,7 +517,7 @@ static int has_proxy_cert_password(void) } #endif -#if LIBCURL_VERSION_NUM >= 0x071900 +#ifdef GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE static void set_curl_keepalive(CURL *c) { curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1); @@ -732,7 +733,7 @@ static long get_curl_allowed_protocols(int from_user) return allowed_protocols; } -#if LIBCURL_VERSION_NUM >=0x072b00 +#ifdef GIT_CURL_HAVE_CURL_HTTP_VERSION_2 static int get_curl_http_version_opt(const char *version_string, long *opt) { int i; @@ -774,7 +775,7 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2); } -#if LIBCURL_VERSION_NUM >= 0x072b00 +#ifdef GIT_CURL_HAVE_CURL_HTTP_VERSION_2 if (curl_http_version) { long opt; if (!get_curl_http_version_opt(curl_http_version, &opt)) { @@ -805,7 +806,7 @@ static CURL *get_curl_handle(void) if (http_ssl_backend && !strcmp("schannel", http_ssl_backend) && !http_schannel_check_revoke) { -#if LIBCURL_VERSION_NUM >= 0x072c00 +#ifdef GIT_CURL_HAVE_CURLSSLOPT_NO_REVOKE curl_easy_setopt(result, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE); #else warning(_("CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0")); @@ -845,20 +846,20 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key); if (ssl_capath != NULL) curl_easy_setopt(result, CURLOPT_CAPATH, ssl_capath); -#if LIBCURL_VERSION_NUM >= 0x072700 +#ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY if (ssl_pinnedkey != NULL) curl_easy_setopt(result, CURLOPT_PINNEDPUBLICKEY, ssl_pinnedkey); #endif if (http_ssl_backend && !strcmp("schannel", http_ssl_backend) && !http_schannel_use_ssl_cainfo) { curl_easy_setopt(result, CURLOPT_CAINFO, NULL); -#if LIBCURL_VERSION_NUM >= 0x073400 +#ifdef GIT_CURL_HAVE_CURLOPT_PROXY_CAINFO curl_easy_setopt(result, CURLOPT_PROXY_CAINFO, NULL); #endif } else if (ssl_cainfo != NULL || http_proxy_ssl_ca_info != NULL) { if (ssl_cainfo != NULL) curl_easy_setopt(result, CURLOPT_CAINFO, ssl_cainfo); -#if LIBCURL_VERSION_NUM >= 0x073400 +#ifdef GIT_CURL_HAVE_CURLOPT_PROXY_CAINFO if (http_proxy_ssl_ca_info != NULL) curl_easy_setopt(result, CURLOPT_PROXY_CAINFO, http_proxy_ssl_ca_info); #endif @@ -939,7 +940,7 @@ static CURL *get_curl_handle(void) else if (starts_with(curl_http_proxy, "socks")) curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); -#if LIBCURL_VERSION_NUM >= 0x073400 +#ifdef GIT_CURL_HAVE_CURLOPT_PROXY_KEYPASSWD else if (starts_with(curl_http_proxy, "https")) { curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS); @@ -1004,7 +1005,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth) free(normalized_url); string_list_clear(&config.vars, 1); -#if LIBCURL_VERSION_NUM >= 0x073800 +#ifdef GIT_CURL_HAVE_CURLSSLSET_NO_BACKENDS if (http_ssl_backend) { const curl_ssl_backend **backends; struct strbuf buf = STRBUF_INIT; diff --git a/imap-send.c b/imap-send.c index 49a5f8aa597..e6090a0346a 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1441,7 +1441,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred) curl_easy_setopt(curl, CURLOPT_PORT, server.port); if (server.auth_method) { -#if LIBCURL_VERSION_NUM < 0x072200 +#ifndef GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS warning("No LOGIN_OPTIONS support in this cURL version"); #else struct strbuf auth = STRBUF_INIT; From patchwork Mon Sep 13 14:51:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12489703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57789C433F5 for ; Mon, 13 Sep 2021 15:37:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41A5260249 for ; Mon, 13 Sep 2021 15:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243324AbhIMPiV (ORCPT ); Mon, 13 Sep 2021 11:38:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbhIMPiF (ORCPT ); Mon, 13 Sep 2021 11:38:05 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79722C140941 for ; Mon, 13 Sep 2021 07:51:45 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id b21-20020a1c8015000000b003049690d882so4374658wmd.5 for ; Mon, 13 Sep 2021 07:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zDbyh/KRPMSli8eUAsRNRa2uPsoD+buxIZwFMXGvJS4=; b=UaltL9JtDe0jnv45ElMRKCbS/L0idiZCawmuXmE/Kj0AN0roU2BmIAqNTAXB6d2KAa vtdWqGwV+dWUg53LldZTyYL8bDaU4uxefL1IUI2Ynv5quLpCs8u+tjqnz2ehDV4MPg61 4VXaFyR4F3JxvzvmENyg5eaUBUMZiIvNoOk7OUazWZ7l+xBOCqLmBntZSn3jq0MHheIK BHywclj26S9ukK79Mv8dW2AeFpkMl8kQclTzl7d3GCCm6KslxzY7lPiBy87RZ13mg4Xn FuKU4gQfokZ5+LXAHDLMnXlmPyZZcU+MQJBLvDQA7KA4sEHPkql7pksD1H0s4gnFEiWB tDow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zDbyh/KRPMSli8eUAsRNRa2uPsoD+buxIZwFMXGvJS4=; b=NW/1zSh3lBjYBRPGOiLUMis2/rSo2ZW/QAlLmpGXqS1MsH4epnOviTZSuQttaMBs89 HpzqZQnpMmKlMbMCUHkjMH2anDR7Obyrpozmzkf0pi639bRNH4wFtuUpL1KOhmWuMJAT r2q8/AowF4UE0wUWUzCyfTS+mFC0EbqBW+OP7Jy4/rx1VYRUF4+EqR0y+E3mBV2iXsN3 jipno6vqzcZQVATHJkilx2rIa7GnIk1WdGiqeY5kJlSRKhBFjeQO6pu8VY7o7BW6jITo yyCCrk1hq5Odxtt4xN3fGfzHraBIrZPjN65pvr1nPYD2Tfuoo8DnSUdJnDHEH+Fk71SI cdLQ== X-Gm-Message-State: AOAM530ix3xOzBx+M7gIWh4b0WKmpTg93kEcJEnFbrw98Dkan/Jlpk5U GHa/0CWLzaqoa7IEmNn1KR76X8+KuvxxUA== X-Google-Smtp-Source: ABdhPJx9tdl4lRo2swAE3cbyC9kynqZMc2GdjuaF7jeEBNRgD8oqJ7xbXOxWxI1TJRhk/6SQWHonhQ== X-Received: by 2002:a1c:4d01:: with SMTP id o1mr7091497wmh.61.1631544703781; Mon, 13 Sep 2021 07:51:43 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id o24sm3638854wmm.11.2021.09.13.07.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 07:51:43 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , "brian m . carlson" , Bagas Sanjaya , Daniel Stenberg , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v4 9/9] http: don't hardcode the value of CURL_SOCKOPT_OK Date: Mon, 13 Sep 2021 16:51:29 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.1013.ge8323766266 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use the new git-curl-compat.h header to define CURL_SOCKOPT_OK to its known value if we're on an older curl version that doesn't have it. It was hardcoded in http.c in a15d069a198 (http: enable keepalive on TCP sockets, 2013-10-12). Signed-off-by: Ævar Arnfjörð Bjarmason --- git-curl-compat.h | 11 +++++++++++ http.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/git-curl-compat.h b/git-curl-compat.h index 7ad87e89ed5..a308bdb3b9b 100644 --- a/git-curl-compat.h +++ b/git-curl-compat.h @@ -20,10 +20,21 @@ * GIT_CURL_HAVE_X. If multiple similar symbols with the same prefix * were defined in the same version we pick one and check for that name. * + * We may also define a missing CURL_* symbol to its known value, if + * doing so is sufficient to add support for it to older versions that + * don't have it. + * * Keep any symbols in date order of when their support was * introduced, oldest first, in the official version of cURL library. */ +/** + * CURL_SOCKOPT_OK was added in 7.21.5, released in April 2011. + */ +#if LIBCURL_VERSION_NUM < 0x071505 +#define CURL_SOCKOPT_OK 0 +#endif + /** * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012. */ diff --git a/http.c b/http.c index 94eefe97089..d7c20493d7f 100644 --- a/http.c +++ b/http.c @@ -537,7 +537,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type) if (rc < 0) warning_errno("unable to set SO_KEEPALIVE on socket"); - return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */ + return CURL_SOCKOPT_OK; } static void set_curl_keepalive(CURL *c)