git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Lars Schneider <larsxschneider@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>, schacon@gmail.com
Subject: Re: LARGE_PACKET_MAX wrong?
Date: Tue, 26 Jul 2016 09:42:57 -0400	[thread overview]
Message-ID: <20160726134257.GB19277@sigill.intra.peff.net> (raw)
In-Reply-To: <077B805D-B618-41B2-84A6-BA2E3E5644F2@gmail.com>

On Tue, Jul 26, 2016 at 03:07:41PM +0200, Lars Schneider wrote:

> I am reading the pkt-line code and stumbled across this oddity:
> 
> LARGE_PACKET_MAX is defined as 65520
> https://github.com/git/git/blob/8c6d1f9807c67532e7fb545a944b064faff0f70b/pkt-line.h#L79
> 
> In `format_packet` we check that the 4 bytes of length data plus payload is not larger than LARGE_PACKET_MAX (= 65520)
> https://github.com/git/git/blob/8c6d1f9807c67532e7fb545a944b064faff0f70b/pkt-line.c#L111-L112
> 
> However, in the documentation we state that 4 bytes of length data plus payload must not exceed 65524
> https://github.com/git/git/blob/8c6d1f9807c67532e7fb545a944b064faff0f70b/Documentation/technical/protocol-common.txt#L70-L72
> 
> Who is right? Code or documentation? 

I think the documentation is wrong. Git's packet_read() will complain on
a 65524-byte incoming packet (it actually handles up to 65523, but that
is simply a quirk of the implementation).

The sending sides always include the 4-byte header in the
LARGE_PACKET_MAX calculations.

So I don't know what was intended once upon a time, but I think we have
to stick to what the code does, because there are many deployed
instances that we cannot break compatibility with.

-Peff

           reply	other threads:[~2016-07-26 13:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <077B805D-B618-41B2-84A6-BA2E3E5644F2@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160726134257.GB19277@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=schacon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).