why does the cmdserver use a 4-byte length field?

Jesper Schmidt schmiidt at gmail.com
Thu Jun 30 17:13:18 CDT 2011


I mean a 2-byte length field seems to be enough for the input channels.

The reason why I ask is because it seems that the bytes from length field
are a non-insignificant part of the total bytes that flow from the server
to client. At least that is the case in the two examples on the excellent
wiki page that describes the protocol. I guess the same will be true for
commands like 'stat', 'log' and 'incoming' if they follow the same pattern.

It could also be that 4-byte integers today are more common than 2-byte
integers and therefore easier to work with in some newer languages. Is
that the motivation for choosing 4 bytes over 2 bytes or is 2 bytes
simply not enough? If 2 bytes are not enough then why are 4 bytes then
enough?

--
Jesper Schmidt


More information about the Mercurial-devel mailing list