Closed firepear closed 8 years ago
This is done, except that SEQ
comes before LENGTH
(such that it does not affect length).
I've just now realized that HMAC
, which is also fixed-length, can be moved to precede LENGTH
as well.
SEQ (4B) | HMAC (32B, opt) | LENGTH (4B) | PAYLOAD
And now THAT is done.
But I want to clean up variable names and comments, so that everything has clear and consistent names. Currently there's too much swapping between "message", "request", "response", and variants when referring to the payload.
A request or response is something that exists from the POV of the client or server. From inside the code talking to a socket (petrel-net.go
), it's a transmission. And transmissions have these parts:
There should be a request id (or sequence number) as part of the header. It should be generated by the client, rather than tracked as an incrementing counter by the server.