git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Joey Hess <id@joeyh.name>
To: git@vger.kernel.org
Subject: surprising value of LARGE_PACKET_MAX
Date: Thu, 4 Nov 2021 14:59:25 -0400	[thread overview]
Message-ID: <YYQtjWSb+z4taphX@kitenet.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

I implemented a git-filter-server using the long-running process
protocol, and was surprised to discover in testing that git rejected
a maximally sized pkt-line starting with "ffff" as having an invalid
size.

The docs don't say what the maximum size is, so I assumed I could make
it as large as the length header allows, which I think is a natural
conclusion to draw from the documentation. But looking in git's source,
fff0 is the maximum:

#define LARGE_PACKET_MAX 65520
#define LARGE_PACKET_DATA_MAX (LARGE_PACKET_MAX - 4)

Which dates back to commit d47f3db75c58139cdcbca5cc63b17bf5db293b6a in
2006, which does not give a rationalle for the slightly small
size. Whatever the reason, it seems likely that changing that would be
likely to break interoperability with older versions of git.

Perhaps the best thing to do would be to document it in
Documentation/technical/protocol-common.txt

-- 
see shy jo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2021-11-04 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 18:59 Joey Hess [this message]
2021-11-04 20:12 ` surprising value of LARGE_PACKET_MAX Matheus Tavares
2021-11-05 14:57   ` Joey Hess

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=YYQtjWSb+z4taphX@kitenet.net \
    --to=id@joeyh.name \
    --cc=git@vger.kernel.org \
    /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).