{"thread":{"id":"42929","subject":"Re: LARGE_PACKET_MAX wrong?","startedAt":"2016-07-26T13:43:39Z","lastAt":"2016-07-26T13:43:39Z","messageCount":1,"participants":["Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"292204","messageId":"20160726134257.GB19277@sigill.intra.peff.net","threadId":"42929","inReplyTo":"077B805D-B618-41B2-84A6-BA2E3E5644F2@gmail.com","subject":"Re: LARGE_PACKET_MAX wrong?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-26T13:42:57Z","receivedAt":"2016-07-26T13:43:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 26, 2016 at 03:07:41PM +0200, Lars Schneider wrote:\n\n> I am reading the pkt-line code and stumbled across this oddity:\n> \n> LARGE_PACKET_MAX is defined as 65520\n> https://github.com/git/git/blob/8c6d1f9807c67532e7fb545a944b064faff0f70b/pkt-line.h#L79\n> \n> In `format_packet` we check that the 4 bytes of length data plus payload is not larger than LARGE_PACKET_MAX (= 65520)\n> https://github.com/git/git/blob/8c6d1f9807c67532e7fb545a944b064faff0f70b/pkt-line.c#L111-L112\n> \n> However, in the documentation we state that 4 bytes of length data plus payload must not exceed 65524\n> https://github.com/git/git/blob/8c6d1f9807c67532e7fb545a944b064faff0f70b/Documentation/technical/protocol-common.txt#L70-L72\n> \n> Who is right? Code or documentation? \n\nI think the documentation is wrong. Git's packet_read() will complain on\na 65524-byte incoming packet (it actually handles up to 65523, but that\nis simply a quirk of the implementation).\n\nThe sending sides always include the 4-byte header in the\nLARGE_PACKET_MAX calculations.\n\nSo I don't know what was intended once upon a time, but I think we have\nto stick to what the code does, because there are many deployed\ninstances that we cannot break compatibility with.\n\n-Peff\n"}]}