From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 521391F55B for ; Wed, 27 May 2020 18:06:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391889AbgE0SGN (ORCPT ); Wed, 27 May 2020 14:06:13 -0400 Received: from cloud.peff.net ([104.130.231.41]:57760 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391878AbgE0SGM (ORCPT ); Wed, 27 May 2020 14:06:12 -0400 Received: (qmail 23196 invoked by uid 109); 27 May 2020 18:06:13 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 27 May 2020 18:06:13 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 6174 invoked by uid 111); 27 May 2020 18:06:11 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 27 May 2020 14:06:11 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 27 May 2020 14:06:11 -0400 From: Jeff King To: Christian Couder Cc: git@vger.kernel.org, Junio C Hamano , Derrick Stolee , Taylor Blau , Jonathan Tan , Jonathan Nieder , Christian Couder Subject: Re: [PATCH 02/12] upload-pack: move static vars to upload_pack_data Message-ID: <20200527180611.GA4020820@coredump.intra.peff.net> References: <20200515100454.14486-1-chriscool@tuxfamily.org> <20200527164742.23067-1-chriscool@tuxfamily.org> <20200527164742.23067-3-chriscool@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200527164742.23067-3-chriscool@tuxfamily.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, May 27, 2020 at 06:47:32PM +0200, Christian Couder wrote: > As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' > more thoroughly, let's move the 'no_done', 'daemon_mode' and > 'timeout' variables into this struct. Makes sense. > They are only used by protocol v0 code since protocol v2 assumes > certain baseline capabilities, but rolling them into > upload_pack_data and just letting v2 code ignore them as it does > now is more coherent and cleaner. Is it perhaps worth keeping these v0-only fields grouped together within the struct, along with a comment? That way nobody has to repeat your research later into which ones are used and which ones are not. > -static unsigned int timeout; This was unsigned, but gets moved as... > @@ -83,18 +80,21 @@ struct upload_pack_data { > timestamp_t deepen_since; > int deepen_rev_list; > int deepen_relative; > + int timeout; ...a signed int. It probably doesn't matter much in practice for the values we'd give it, but the alarm() to which it's ultimately fed takes an unsigned int. -Peff