From patchwork Sat Sep 11 09:34:15 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: 12486237 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.8 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 1D853C433EF for ; Sat, 11 Sep 2021 09:34:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF57660F9D for ; Sat, 11 Sep 2021 09:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235597AbhIKJfm (ORCPT ); Sat, 11 Sep 2021 05:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235481AbhIKJfk (ORCPT ); Sat, 11 Sep 2021 05:35:40 -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 EB78BC061574 for ; Sat, 11 Sep 2021 02:34:27 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id y132so2871030wmc.1 for ; Sat, 11 Sep 2021 02:34:27 -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=STnTcNCjNcJibo8vTW5Xdv72QktRyPLwrCQ4pjmGfec=; b=mKUq/hpN33wHo4rvtWOynakr8fWx9ZXXKZbMAdLW+WJlIho2qrbG2eW38K3fd397ZB FQJLSU2Ybhc0wp6sILtC7rgG54V76Xl5gsHZQnaEiB2tWxP1k/YBILcv8SbgZWFCrmJL hjsQw3APWoRqpzTfFGElj2PYvUw54s3cdk4wudYA23jn0ze0pGrb8x3Mm1kF94LK4ayy 7nrgt/hiPXWT+mLNbkaB3GHhqjhTyzpd7wnrUMKnwXPT+FTiygkQ3CAn6GMrLfYaEP4O /5KR6WTUqbc50BFgT1+v8zhzeZuHW/s/GRbATVUa8c85Qa8N0LnDNhcgRbpftIp34CX3 pzCA== 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=STnTcNCjNcJibo8vTW5Xdv72QktRyPLwrCQ4pjmGfec=; b=HZkZUju65+cU9e/iqs/aoBLJ01XF5Nqd9s2fCstbqc0xBw0K2pEs4oYC8enixY9XoT Jesl+R9LP+l2xL876Ssm+cT/ZnQPypkiGRPSmGS6Q5ZULuqupzK5n3aY43E1LoLGNs6G sjE6ZffZUn7TH8zw2NWVtivc7fKyf9+b4lhfl6YGYaYH2xugnz1LGURVmn/ZDEjqgSaj 9hxm2vVOtA5r95Qty9uHFglKo3wn/SlxIOT9pTB3kKU07v75sOKI35pD0zbDjFybkw/P QDibJQ6JVgvw80Riwx+tTVF1aBj398mUOuIHjj2CZrN48bMEAUDDs5tz9yz5x/dd5RTE EDpA== X-Gm-Message-State: AOAM533YG9mmaOqblFSkPkVkDOUQaQy/dXfod+hpuZJ74RnwSKk6Muxs Ew8iEj0sWYoCXm3780/1Y2Dk2YnDl/zwDw== X-Google-Smtp-Source: ABdhPJxItloC0/4a/zQXHddqrttSgAKR0Gqhrr15pmQDO+xb7sc35sMGYKiFHZcWRAg+HDTw2a8LkA== X-Received: by 2002:a1c:9d8a:: with SMTP id g132mr1938008wme.17.1631352866198; Sat, 11 Sep 2021 02:34:26 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:25 -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 v3 1/9] INSTALL: don't mention the "curl" executable at all Date: Sat, 11 Sep 2021 11:34:15 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34:16 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: 12486239 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.8 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 1B9AEC433F5 for ; Sat, 11 Sep 2021 09:34:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF3E1610F8 for ; Sat, 11 Sep 2021 09:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235601AbhIKJfn (ORCPT ); Sat, 11 Sep 2021 05:35:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbhIKJfl (ORCPT ); Sat, 11 Sep 2021 05:35:41 -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 A509DC061574 for ; Sat, 11 Sep 2021 02:34:28 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id n7-20020a05600c3b8700b002f8ca941d89so2998156wms.2 for ; Sat, 11 Sep 2021 02:34:28 -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=ZCyNg1e+cRlEflagvnBmtZzEiwVterMMa/xg9C3+kyw=; b=nK9jzyzMvqHoyFDNWOAbCOklXMtzLinZDNqfM/9hwoAav0da3UDoLpdzCTg4VzG9Bb 3PdkJJ9bA7jcELYIqziduF/AHHNbhO0h918hkSm/30zSmK1SgNwjpbYZuO8aGurOAWv8 AUmybxUum7Wbc08bhD54v10Yxix3r1y1ah6CtSIVJPyvL4+c8VhrOIHLTW6Br5LYlUuh 8QlnRpixLF9VH5dUto0K5zZ5hYIp2yvD11t7lPkwjjop42X0K0jzht6Nkuiw9wEOfPgr OWf3DAlw4gHJr23DyEZvucu2fgXIPAOPG81ukcyS7rb9eH6kypo7mc587dti7MI6pM9D 3tBA== 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=ZCyNg1e+cRlEflagvnBmtZzEiwVterMMa/xg9C3+kyw=; b=06uOUJVymZIrW4T3oN61DeFNpyyPTDYkLSglvdm674S2lsEnEOhRPnVWocrXMyNw5t hER44a7PmeySdo8zo42N17LEmNxJpmM9Xera5qJp4+1Sy2SXMeJay91c2wMC+6zn2dsR pLiG7pcYLjZFX6L4K5YGI7jTBBsi//Wg9M5hRQIg2osL/oMasH7u6NLVoWEqF1lu177f zYzny79tPc1uEPHgOsoKI4CdllZzuK2pP+Qmk+jVEqn65SA4x3L4yce3p49MwCjqz6Bp eylRxPJZOkQBHksQghOSUrWc6KQjK7x2i3gStNURYgcxmYKO/H94OMitGCN/9FTGwGmK Ze6A== X-Gm-Message-State: AOAM533WwaHAg9LxmG5HfuSDiCcvJYdLiPVLkOylRyPztlvJNqvQfBAb I1NDFmEoLskBiO5B2BesXNWSCvLdePgYiA== X-Google-Smtp-Source: ABdhPJzo/mnlS9tdVTs3X1yTalw6Wzzl4jxqIaOLZNyuzTNGWg7X+T8ZZ58xJBrPRsT84KZRzj0Hpg== X-Received: by 2002:a1c:2057:: with SMTP id g84mr1991652wmg.140.1631352867021; Sat, 11 Sep 2021 02:34:27 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:26 -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 v3 2/9] INSTALL: reword and copy-edit the "libcurl" section Date: Sat, 11 Sep 2021 11:34:16 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34:17 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: 12486241 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.8 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 2C89CC433FE for ; Sat, 11 Sep 2021 09:34:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 112F9611F2 for ; Sat, 11 Sep 2021 09:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235613AbhIKJfn (ORCPT ); Sat, 11 Sep 2021 05:35:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235593AbhIKJfl (ORCPT ); Sat, 11 Sep 2021 05:35:41 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4E8C061574 for ; Sat, 11 Sep 2021 02:34:29 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id n7-20020a05600c3b8700b002f8ca941d89so2998166wms.2 for ; Sat, 11 Sep 2021 02:34:29 -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=tonfJRNugWaQnE1NJWdysbaFoIv02QBwjz55j2hSIQ8=; b=bC5SUCysbmEDTdJGlbgVGysPZp2RKxtsJ5NSn1wm0cdw+RLwijNZFvI8mIpjWXC8n1 p+yFbQQQ/SpGyi0qCGvKEXArnIqPlIzAZP4Q+cJ/SsoNy8lg2OW+wq8pIn5cwcvnBE3B 32WBf+VvxFeqbnQ3XRisLyLKwDAHGzMc17rD+lxE3R3Hh6x0+MWnSyLXYYM3LRXwFk0q pUjktiBm2FPYaqvyIZxkGBipZKeVV4swQRVnArqCy2GQPwgWTFpAKtYx8Dl5nT1170Rk K0Uw8dU0zhMQPZJDBk+3LZ9YvdOJCStIwE/7xY+y4FveoXxxkv0O2TjkLKeDpW5kUQ1u UxqA== 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=tonfJRNugWaQnE1NJWdysbaFoIv02QBwjz55j2hSIQ8=; b=kzdYvh+Nd4FDWKUxCjmYk+kq1UMuVkbav2RtXhEDpDgdTUGC4K1ptOHNm61xBkutyF jZbkZjbdvJP8l5tMF3Ell8I7MzSVCfG6nRI6qPl7qyVZCUNLQvrJk+qyq5JLyBNCXUJb rE09Y+tothlhzmXNSqbVx+BnXtnZ7EjY7Ly2uRNM32zel0skxm8bRHNRx7fgkQ2AXb57 9olLxov9UJGPkHO8W4ln4O+TWH/WqAsJkj7mDzVcpSBmzUMOmH73NhaQs/w2DYNzrdVV hZznIOumaaqtpaHyLboPzbEvmS6YbMwN84TrwegGJlp2Il43rFRiNFff3E9BNnU6mhGK VmgA== X-Gm-Message-State: AOAM5309ElwzEk3agMR3D96ivEcoRjK4cnbn0F8kBx7iyTzfbVJlEJrq xb04Op0XoBe1xh4XwauK3rHz7ARx9Z1WLg== X-Google-Smtp-Source: ABdhPJwgUhjS6aDc/ydNFMS0cqw/m9b8mJ7RCx3scWprQTX1LZdYvg9J3YJibfAwZ6WPWFt0Vkvbow== X-Received: by 2002:a1c:a747:: with SMTP id q68mr1957254wme.180.1631352867787; Sat, 11 Sep 2021 02:34:27 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:27 -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 v3 3/9] INSTALL: mention that we need libcurl 7.19.4 or newer to build Date: Sat, 11 Sep 2021 11:34:17 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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..795b02b6f96 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 Sat Sep 11 09:34:18 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: 12486243 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.8 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 3D59DC433F5 for ; Sat, 11 Sep 2021 09:34:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20AEC610F8 for ; Sat, 11 Sep 2021 09:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235625AbhIKJfp (ORCPT ); Sat, 11 Sep 2021 05:35:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235481AbhIKJfm (ORCPT ); Sat, 11 Sep 2021 05:35:42 -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 4D5DEC061574 for ; Sat, 11 Sep 2021 02:34:30 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id q26so6256490wrc.7 for ; Sat, 11 Sep 2021 02:34:30 -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=8CUJ9JOnHzecSgSzLoU4bq9Gr8Ksw8h20GZiupK5mLo=; b=ocfKPZJyzt1VGy3aurFJZQCUNxQJP+Ljmq2mwqEQwxNBFGNv8+lmNohD+629nEpE0u 1d3Hw6cg/P9OC2o6lIzABt99mUbKxJJkPlZNln/4K9lWNyPNTQDrdKQTI0doMpA1azww nUS/NNrRiURuBhC8lyHM05lPXfKhb9hQq1ea8BCanhqoJQj8YD8axJLRAtHZj/giq1T+ REjtyVhERnKDMfayuwizD7Gi/ZwKMF6YJYQzbgaXNalz4F5AhhGsATgk06nYwlvAgrj7 E9b25hH3Ic1+AyfXFJmyBYQwsg4EkEv52AJ6qID7w/t1Bt13K8xX4TaZNBhH9I/zRxSN g18A== 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=8CUJ9JOnHzecSgSzLoU4bq9Gr8Ksw8h20GZiupK5mLo=; b=fbjP7OCZHEeKY4fkRbj1sfXVGBfmt2Xc/k2ZUReZClgRrNOZvDsJSopUvKpd6OCDGj SvaV4TGU6tSvFWfbdBosgXtMep1Rafn+fnejDGtpCqExzG0/rkPdPF3RszyElBBW4aTc fPSrBrWTvQulrdpwtJZXRdqWsq27sO8kvX1wARSh+KSa0kiGrfjgL6r69MPiPkdMfG5D Yr8tOjZvw4AhxiQAf1ioLvw1CyT7cfVgrSGrAHj0QnFmnx5LKFTGWbqaCaxdVMu8FCUF yNax30BynKdvzv+RBe+ngOn4VU5+eKp4zjzB2cmrBSS07j1kbvC4aCdumXmY3axPuzip EOsA== X-Gm-Message-State: AOAM533VepExk8B9FVle1bXXPDShbxc33NjTX0CtOQTGKYXsR4BeGzgc emXDrVci7rcbRu+D7IXwi1de9v33mqZ1WQ== X-Google-Smtp-Source: ABdhPJyqHu8dCqGYzb4IRnAMlcqmKg0rfp5bN6wDpZNwU/3wL9invvZYy9kG02fFbBssBfVPwxnBzg== X-Received: by 2002:a5d:58e9:: with SMTP id f9mr887985wrd.325.1631352868665; Sat, 11 Sep 2021 02:34:28 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:28 -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 v3 4/9] Makefile: drop support for curl < 7.9.8 (again) Date: Sat, 11 Sep 2021 11:34:18 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34:19 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: 12486245 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.8 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 E6794C433FE for ; Sat, 11 Sep 2021 09:34:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE1D7610F8 for ; Sat, 11 Sep 2021 09:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235630AbhIKJfq (ORCPT ); Sat, 11 Sep 2021 05:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235616AbhIKJfn (ORCPT ); Sat, 11 Sep 2021 05:35:43 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D270C061756 for ; Sat, 11 Sep 2021 02:34:31 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id i3so2865181wmq.3 for ; Sat, 11 Sep 2021 02:34:31 -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=sbzeP7rqQ55dap+sdL66Tw1VxC9BIp0gVmb5VUIimZ8=; b=jgt7DfjJaK5yQh9Uu3JaEM3sgyGZWpZdPP1dSMa6MQSMBq6dzSj9Wl2CV5yuNZISfd jQb7I5Hp97mpA4CDo88T6rmjd2PRhzRCFtRDp52esI9g2TYk/HD1O6ny8ihU9DXE0c6F ik4SZ+Kk+6G24VrdrpR84REFWReJuo1GIkp1G5qOnomMdxcQYArXWPbxJfBJS/zh8L0v HOtMTWhND/av2UXOae391HOfQTztP1Le3mP4n0Z7a0OXuZx7KSBhuwoAmXzndYwqvdyy L6RM+BVGYcTsMjtVnpcgCQyXrL9+w6Fd5u+htFUpUN+ZRJA6FrnfXxY6IdRVQ0r4M2OR xsiQ== 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=sbzeP7rqQ55dap+sdL66Tw1VxC9BIp0gVmb5VUIimZ8=; b=rdQCDHlzyhYdvE3Vy4Gz67ZEfhkfU5Cs4EiyMqGnt1w1szk4deEWk8fOQ5B7JYfB4C u0Im+30xkbhVo8RzhDYlhH0PuM+45omi3aKKHgKnxll+4APWOm0FhJ6nmOp+Isz+fWT8 unp/JMlxwXx5wnTAxckQUWNNvvBWdzE8dE+I6O5oeRet8WeqaNRKTLKwsx1JFSM4oDbR Q8vstnEbQGoFUhacK1dKX9lcF+Y6Qee7Z0AplOUQNE1N7gu28leiDC92vQq+laSTQne6 XwJrkyCm+XFsO9LzBuXjEYTwbLkCjbl4fppcL3n8TMdsjJFmT0H+jjWb55rOqjBAGtPx v1+Q== X-Gm-Message-State: AOAM530b0445mU3sQ/cn5xh47pukGBEHfstT1rhkFbv0TNPP1ntvzonI Q+txfGaWtpwomZfkv7ySQQ0apwsrqjSgqA== X-Google-Smtp-Source: ABdhPJx8ThwATtW1ndUYdzJtyWnFVOFAdHh21jf+w7ULW+CwLvHoguOhHbKaDqagrnagX/nhdJiZ2A== X-Received: by 2002:a7b:c114:: with SMTP id w20mr1918006wmi.80.1631352869446; Sat, 11 Sep 2021 02:34:29 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:28 -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 v3 5/9] http: drop support for curl < 7.18.0 (again) Date: Sat, 11 Sep 2021 11:34:19 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34:20 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: 12486247 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.8 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 12B26C433EF for ; Sat, 11 Sep 2021 09:34:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECA8A611F0 for ; Sat, 11 Sep 2021 09:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235636AbhIKJfr (ORCPT ); Sat, 11 Sep 2021 05:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235620AbhIKJfo (ORCPT ); Sat, 11 Sep 2021 05:35:44 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7B6C061756 for ; Sat, 11 Sep 2021 02:34:32 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id u19-20020a7bc053000000b002f8d045b2caso3001657wmc.1 for ; Sat, 11 Sep 2021 02:34:32 -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=rMpkRluVbLg4VZlXMnrx1Umh956bpQoNk8lU0Lfz67E=; b=K644oDWQbfy/xD4mh+P3VPida9PeVEkUb92eM5jr5azHv6fUUkt4o4sfikB/00Palc f8KWH2mGzHQppc2DykZ8tZ26hVwjZUMUCNpJVOLzfWrRLSoiHxQDS69rfxeJUlnOIxmA kfcLDTc3lSnCPqN/JKY/GcSpnfgRY6kQ2J9FPBumw4QnESUU1IUjMzYKevdbizobBJhu wKwdVy0sMBNN/ej4BLlCKDNOApH1j8dwfrQPoIjWRSOUBOexY0BJSKysBFOFKHnFRW8x bkgllrtli/5UW+yylHhG01YoeOSGekjsu+fIkuIhN2s28aJQ1VGX9tLDFYwLY/3GfKkA NB/g== 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=rMpkRluVbLg4VZlXMnrx1Umh956bpQoNk8lU0Lfz67E=; b=ovmbvTEHTGBOUYQto+IeVZk5T5Ef+J9JlZNB553NOrtrln7KA77/gjNuiRzc2PyScL 7sCof4+J+/mM9w9284zTdkUzWXgivj804FOzYseTG4A0zsM68hS9skofhCo1OZQ4stLO O1y6PpkQ6V+F9qwGfyk6Bo9ElQZk/cjwfFrJb0iMIy43gRVCcpKGpb106fzNDJ1G0p2F Z0oAtE0Anelty1qZpyaVkCSAqwTEr2+BNVVtbNdaHNcuUoPvYaEvt+1XeZ6qM2kIC0kp IgdBT1oaYD9QzVwa1EubbktZI5LWxhW/pCUQlNi0wGYgO6iRKZaYLFVSRwAuMr1d3toD AbCA== X-Gm-Message-State: AOAM530Ymmslr2zuOjKRJWoBXkbjlSWxaLWHw1GmrA11YTrM6BCGcd5k tNcmIoSAPMaOmt8RlvdpKnKxFKjbpWIx+Q== X-Google-Smtp-Source: ABdhPJwV4l1FF/udJYdTdkaAzlcFSv6THYyzV7Op6Pj81TjJGDLaLIJtrpvXtYf5vzC2w7pn15Wrew== X-Received: by 2002:a1c:4a:: with SMTP id 71mr1983145wma.87.1631352870415; Sat, 11 Sep 2021 02:34:30 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:29 -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 v3 6/9] http: correct version check for CURL_HTTP_VERSION_2 Date: Sat, 11 Sep 2021 11:34:20 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34: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: 12486249 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.8 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 A38C9C433F5 for ; Sat, 11 Sep 2021 09:34:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 820F0611F2 for ; Sat, 11 Sep 2021 09:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235646AbhIKJft (ORCPT ); Sat, 11 Sep 2021 05:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235624AbhIKJfp (ORCPT ); Sat, 11 Sep 2021 05:35:45 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F19DFC061762 for ; Sat, 11 Sep 2021 02:34:32 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id x6so6246790wrv.13 for ; Sat, 11 Sep 2021 02:34:32 -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=p6sAdv6gcAx92uKQ69Z6XJSwGRBaNoHiaJMILFPM5Vo=; b=bGqafKbTz6U+zarC1rFYD1VE16UoWvFiv3KrERp7eSudkU8l/L7KytTTD85D7FGQE5 ep+59z5r/4E06KvUE8K0ye1q+skK5VSsFSvxFwJadeHic0zjRGihVNA4JQZuu4a4qlcQ Xfu7SnkA9W4DmkCq3e5N9/kilnxw375hBln9/CGHFhCMDujqJ50AairKLmHJkb1I77mk NArpeJjwh8/bCe9x6L75Nw1BUWp9lA2rhYvrPPpJIg6UqHgBLGFLHSAcg8qsQnF3zcFU wMszeVUBjKd/m5OoTbcRGIt1HgX+KIlqPub3if1+NW4/f1yLNp++mg+Dls4NsqB6i9G4 iJzA== 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=p6sAdv6gcAx92uKQ69Z6XJSwGRBaNoHiaJMILFPM5Vo=; b=VV0znoQsXn7DzwUw7jzHMU9ZP714vCzFwmpbeL9twiGWeaGQgDTKugEw/59rZD4Et7 BYPKPO+dmdi/6sFhiWE3lriMuzI1JEHbwk7ysjEY31kYSgDBn01TQENx6ttyE5sbEJo6 6N3Dk4RzJRpbs3sxdvvFmoE6mBe2h5EU4cgMKqYfAIZ0fwfbd/0NdaXSDcW3Ko2qY+Bs 1VbyNX7Stud88XOVj+pMOx7h5VVrJ4QZpyq/VIpG6YJLhw0CIYvWz4ZqAXohxh3ibawv 5BhHlBqGg/NyyLjSpfA/QnqqzS+vk7YQ13vjl9pt75CA3ogVRkPFiifX/o5A92sYA4Ej hBNQ== X-Gm-Message-State: AOAM5332qMNQruVaqcYX54DC2Fdk4GJz/cngcsZwL6IcnwS9K31py7gO xLa4xBY8/ltfLTeZf3fI31b3IKKY8MQtpA== X-Google-Smtp-Source: ABdhPJzEVAfO+znWQV+PGpVOzQ8al8el9NP+WlgtcHFO+i4F6h6Yyerpvwgw4g6J/GwFtE/JOW57+Q== X-Received: by 2002:adf:f541:: with SMTP id j1mr2274145wrp.180.1631352871185; Sat, 11 Sep 2021 02:34:31 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:30 -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 v3 7/9] http: correct curl version check for CURLOPT_PINNEDPUBLICKEY Date: Sat, 11 Sep 2021 11:34:21 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34: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: 12486251 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.8 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 22F39C433EF for ; Sat, 11 Sep 2021 09:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CB2760F9D for ; Sat, 11 Sep 2021 09:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235640AbhIKJfv (ORCPT ); Sat, 11 Sep 2021 05:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235627AbhIKJfq (ORCPT ); Sat, 11 Sep 2021 05:35:46 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2FDBC061574 for ; Sat, 11 Sep 2021 02:34:33 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id t18so6325753wrb.0 for ; Sat, 11 Sep 2021 02:34:33 -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=f8i3RQq9ThlGST9+kEgj0g1Yf8YWIqAxy8Z/CZQ2ZM4=; b=MulgL4DqxXNYhm/gI0oj1LqUb3Y1s/I5GHUpxwEZQQpwIvHnPAVITjKMn7h7BnItoo Wm9rVPkpeKxI45yPD3JKLL2CcI9Tm4wX6BmRz9UXR8KDbwQ/gLrhIKj4XPkFivSrtWXH Vz2IxubhUDP7NyE59l8CFJHUV8AkziWbkJHi75DnM+awmIQvcR//kr4nJpAF7gGBeWId QxEOChAaVrpEpgpEpWM1ERnpZ3YBpyvx/UWCjCsWZYdvY1CBY9KpFXACcVCAdp0Ml9/U t9fSi/Fz37zCldObZDRCBKlnrnTTM0zNQ0HEtEcs/cVJAv85ZAhXCEz/81L7Wk50LXva iqwA== 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=f8i3RQq9ThlGST9+kEgj0g1Yf8YWIqAxy8Z/CZQ2ZM4=; b=pSPi3fJ+j074tjhFuTEH//KJIPxG3zbn+aOt1nNTjrk/mRkzsYbRy9m4NtLtA7R5tV QhHaSQqOZWPWcaQlmo/IpcrUjEjETOXGUWSzM2HTilNIc4xQ4OzbhnVfRANXpeoLb9Ma vtbuxKcwww+ILGW/n75AoFCmBPqn94bcysb70oRmMaVgoYiLzf1bfB99KuPUoCRA2trR BngKHbAsUf8iaPkwZTfq/gY5UfzqPrevnsr+bQ8I6HCf4HReCxXaPuE/spvSyEJMMqkw 1mub+YTeAu1f8smMVOFHl/+9Wbzt7MolKFeDzeFYZ6zTBOGXTWhzmPkEtGrgPv5zh3l+ lNfQ== X-Gm-Message-State: AOAM530aWfkPMoEOAcVGJK8T1vtNlZDyAPcu7Y8Xgr7V2XWc0DUquxhs nW+fvCDFbe8urQspXw0Uqp+Rj9up0OShHg== X-Google-Smtp-Source: ABdhPJzpa/AtGKgjjdQpf0Mq60leeeyfnH6UNboRnhkIRfWcsSywHg23pcSTopx9eDtdAyigNOg0BQ== X-Received: by 2002:a5d:4285:: with SMTP id k5mr2299989wrq.131.1631352872126; Sat, 11 Sep 2021 02:34:32 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:31 -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 v3 8/9] http: centralize the accounting of libcurl dependencies Date: Sat, 11 Sep 2021 11:34:22 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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 Sat Sep 11 09:34: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: 12486253 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.8 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 DF688C433FE for ; Sat, 11 Sep 2021 09:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C592A60F9D for ; Sat, 11 Sep 2021 09:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235687AbhIKJfw (ORCPT ); Sat, 11 Sep 2021 05:35:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235593AbhIKJfr (ORCPT ); Sat, 11 Sep 2021 05:35:47 -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 BA70CC061760 for ; Sat, 11 Sep 2021 02:34:34 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id i23so6281409wrb.2 for ; Sat, 11 Sep 2021 02:34:34 -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=7FrwRk0mopfY+otwu8qltoY5vDAQwZGcma/GR9MLWjM=; b=g0KLCWAgzp6SThgWnr+oEG4lB5lZMfJHVSfaOlytZAn6hPHIRD+KG7FkZbPNRbpBYU ozIQUM2mv/0Aj99dinWseuzRylFLrejjQzAwsu3o9jlI7/jXsYwntL+GG3VWZrBl14qV N0TFse9rcWREetpZZslNIWy4EfduGId4fU1M83T4j5lt8me2K2R3EhooUCO25Oszwxhw 2a8dGeTBqRvo7GQXHhiZiS7UHG3mHRPtYIOknAQiiQODJ0V25YhyclQGtlBMONOl/vb3 XNp/ftQje/HIbnDnxrkUXZxTCZnBZ3ItORMHxXAGR8VKKw2qp0dVdf5tbkzG8MSgZqQT aFPA== 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=7FrwRk0mopfY+otwu8qltoY5vDAQwZGcma/GR9MLWjM=; b=5vKAqugDyiBLmyjSaipiCM8PlC458JO0uPPHtMYD/3piqXg4kzfR0R/62yfH5d4625 iuDyUl1Xj3zUti/Y6LpcrhAVqQf5wHSKrGh+qG9yqwDj5EsTW8sTrNT3Fi9VVlZfYBjR kkz86VdYAnO9j+xN6xL4i59RSQPHTm4sQqE5I3qBsY25HRvXS9PF2DjWlbJSJJa4xvxr BKa8CObdCj6XZB9v05uoST8pHOMCxdbpiTuKrObM2e0TSmOKXSATRaZdyQ6abDsusvc4 Mv6h5w9z6B0wo5rfT5SYBCJh6mJHJ+zh1s2mk0cAW0tqDBkXOkNNIUeeMszmo2B8HbKF xuxA== X-Gm-Message-State: AOAM533sbjstdHpxM4bZeM6W6/S6ZlhEUS+K4/f7X1QWptxDL05gLpV+ DptQoxLT3goN7zhQIcNNmHWJsH+aDU7WBA== X-Google-Smtp-Source: ABdhPJz+58WDfnf0+Bze32vUtMNCwQsgKcePCZLyau1rtOpFX7BxaZtbV7ESIdEH/a5inwlYT68New== X-Received: by 2002:a5d:6a49:: with SMTP id t9mr2268396wrw.35.1631352873129; Sat, 11 Sep 2021 02:34:33 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id s10sm1161753wrg.42.2021.09.11.02.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 02:34:32 -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 v3 9/9] http: don't hardcode the value of CURL_SOCKOPT_OK Date: Sat, 11 Sep 2021 11:34:23 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.984.gea2c3555113 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)