From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 CA28EC83000 for ; Tue, 28 Apr 2020 21:23:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A26222072A for ; Tue, 28 Apr 2020 21:23:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="ZN5oe+AT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726658AbgD1VXn (ORCPT ); Tue, 28 Apr 2020 17:23:43 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:55479 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726274AbgD1VXn (ORCPT ); Tue, 28 Apr 2020 17:23:43 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 736D3C1888; Tue, 28 Apr 2020 17:23:42 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=e3gjbjafgjwTblymh9jjjhzLAUM=; b=ZN5oe+ ATIsUjmalxQ7Gk6X/UbjUMs7BKFEWDusvLR3H/WNxPf7WgpFeL8JS94TcB3OtQxq LUS7MbhY5jEXnU6m5Z3BcOYZuWuBd96r9LtyrHRQjHG3JbhW8LEOnCwCNsI4nwyD Xk8m68CsrQghexQ1vrP1ExsMWuJV9FY93PGhU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=TpOQ55f8C1txBlM3bsGXIOV7NUUIrb9I AjJhJy0qHV6Vx8LeTuTKnjFNPmuVqCVOcdpVlzW+aUATeolurYCHH/o3DOmLbEuT mhIX0pw5wq+ytAM08H2gSSU19vJqpWO7ss+t2NtgNXmxk/DMiWfJ4QQ6bCKcZ54g w4NxP18NtPM= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 6B08CC1887; Tue, 28 Apr 2020 17:23:42 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 9D7A3C1886; Tue, 28 Apr 2020 17:23:39 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Christian Couder , git@vger.kernel.org, Taylor Blau , SZEDER =?utf-8?Q?G=C3=A1bor?= , Derrick Stolee , Christian Couder Subject: Re: [PATCH v2] fetch-pack: try harder to read an ERR packet References: <20200428074442.29830-1-chriscool@tuxfamily.org> <20200428204908.GA4000@coredump.intra.peff.net> <20200428211736.GG4000@coredump.intra.peff.net> Date: Tue, 28 Apr 2020 14:23:37 -0700 In-Reply-To: <20200428211736.GG4000@coredump.intra.peff.net> (Jeff King's message of "Tue, 28 Apr 2020 17:17:36 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 8751E8AA-8996-11EA-9C2D-B0405B776F7B-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: >> If the mechanism to do this were limited to the packet IO layer, it >> may be more palatable, though. > > Agreed. There's not a single place where we write, though, since we > often form packets in local buffers and then write() them out manually. > So it does have to be sprinkled around fetch-pack.c. But certainly the > damage can be limited to that client network code. Yeah, I do not mind "sprinkling all over the place in client network code" at all. The ideal is if we never used write_in_full() and always used this "write but if we get a write error then check for ERR packet" helper consistently (which means we'd convert all the writes done in that layer, and by definition that may have to be "all over the place in the client networking code"). Thanks.