git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* surprising value of LARGE_PACKET_MAX
@ 2021-11-04 18:59 Joey Hess
  2021-11-04 20:12 ` Matheus Tavares
  0 siblings, 1 reply; 3+ messages in thread
From: Joey Hess @ 2021-11-04 18:59 UTC (permalink / raw)
  To: git

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-05 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04 18:59 surprising value of LARGE_PACKET_MAX Joey Hess
2021-11-04 20:12 ` Matheus Tavares
2021-11-05 14:57   ` Joey Hess

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 NNTP newsgroup(s).