{"thread":{"id":"56845","subject":"surprising value of LARGE_PACKET_MAX","startedAt":"2021-11-04T19:08:35Z","lastAt":"2021-11-05T14:57:41Z","messageCount":3,"participants":["Joey Hess","Matheus Tavares"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"440475","messageId":"YYQtjWSb+z4taphX@kitenet.net","threadId":"56845","inReplyTo":null,"subject":"surprising value of LARGE_PACKET_MAX","fromName":"Joey Hess","fromEmail":"id@joeyh.name","sentAt":"2021-11-04T18:59:25Z","receivedAt":"2021-11-04T19:08:35Z","isPatch":false,"sender":{"key":"id@joeyh.name","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"I implemented a git-filter-server using the long-running process\nprotocol, and was surprised to discover in testing that git rejected\na maximally sized pkt-line starting with \"ffff\" as having an invalid\nsize.\n\nThe docs don't say what the maximum size is, so I assumed I could make\nit as large as the length header allows, which I think is a natural\nconclusion to draw from the documentation. But looking in git's source,\nfff0 is the maximum:\n\n#define LARGE_PACKET_MAX 65520\n#define LARGE_PACKET_DATA_MAX (LARGE_PACKET_MAX - 4)\n\nWhich dates back to commit d47f3db75c58139cdcbca5cc63b17bf5db293b6a in\n2006, which does not give a rationalle for the slightly small\nsize. Whatever the reason, it seems likely that changing that would be\nlikely to break interoperability with older versions of git.\n\nPerhaps the best thing to do would be to document it in\nDocumentation/technical/protocol-common.txt\n\n-- \nsee shy jo\n"},{"id":"440481","messageId":"CAHd-oW6q67u=XGCGK=n25Kjph+ceuqPHLxQ0LH=Vydn4xctZ-A@mail.gmail.com","threadId":"56845","inReplyTo":"YYQtjWSb+z4taphX@kitenet.net","subject":"Re: surprising value of LARGE_PACKET_MAX","fromName":"Matheus Tavares","fromEmail":"matheus.bernardino@usp.br","sentAt":"2021-11-04T20:12:02Z","receivedAt":"2021-11-04T20:12:19Z","isPatch":false,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"On Thu, Nov 4, 2021 at 4:08 PM Joey Hess <id@joeyh.name> wrote:\n>\n> The docs don't say what the maximum size is, so I assumed I could make\n> it as large as the length header allows, which I think is a natural\n> conclusion to draw from the documentation. But looking in git's source,\n> fff0 is the maximum:\n>\n> #define LARGE_PACKET_MAX 65520\n> #define LARGE_PACKET_DATA_MAX (LARGE_PACKET_MAX - 4)\n[...]\n> Perhaps the best thing to do would be to document it in\n> Documentation/technical/protocol-common.txt\n\nCould it be that you consulted an older version of this file? The\ncurrent [1] version of the doc says:\n\n\"The maximum length of a pkt-line's data component is 65516 bytes.\nImplementations MUST NOT send pkt-line whose length exceeds 65520\n(65516 bytes of payload + 4 bytes of length data).\"\n\n[1]: https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt\n"},{"id":"440537","messageId":"YYVGVoaJBzMDfyqi@kitenet.net","threadId":"56845","inReplyTo":"CAHd-oW6q67u=XGCGK=n25Kjph+ceuqPHLxQ0LH=Vydn4xctZ-A@mail.gmail.com","subject":"Re: surprising value of LARGE_PACKET_MAX","fromName":"Joey Hess","fromEmail":"id@joeyh.name","sentAt":"2021-11-05T14:57:26Z","receivedAt":"2021-11-05T14:57:41Z","isPatch":false,"sender":{"key":"id@joeyh.name","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"Matheus Tavares wrote:\n> Could it be that you consulted an older version of this file? The\n> current [1] version of the doc says:\n> \n> \"The maximum length of a pkt-line's data component is 65516 bytes.\n> Implementations MUST NOT send pkt-line whose length exceeds 65520\n> (65516 bytes of payload + 4 bytes of length data).\"\n\nI'm sure I did read the current version, so I think I must have glanced\nat 65516 and seen 65535. I don't see FFFF in decimal very often.\n\nI think FFF0 would have stood out better to me, but still the current\ndocs are ok.\n\n-- \nsee shy jo\n"}]}