git/list[1] front-page[2] threads[3] people[4] search[5] about
 

surprising value of LARGE_PACKET_MAX

From
Joey Hess <id@joeyh.name>
Date
Nov 4, 2021, 18:59 UTC
Message-ID
<YYQtjWSb+z4taphX@kitenet.net>

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
Next: Matheus Tavares
Message 1 of 3 in “surprising value of LARGE_PACKET_MAX”
  1. Joey HessNov 4, 2021
  2. Matheus TavaresNov 4, 2021
  3. Joey HessNov 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.