Closed firepear closed 1 year ago
Should this also change the wire protocol? And if so, how?
Either of these would do away with the need for a qsplit-like function; cmd and payload would be read directly into their respective buffers.
Regardless, the wire format needs to be documented in the actual documentation. It is in a comment, but I just had trouble finding it and I wrote the damned thing.
I'm changing the protocol. Request and Payload will be run-length encoded, amongst other changes. So far this is a doc-only change, with code changes to follow.
Started working on petrel.ConnRead
and it is really a mess in there. There are so many parameters being passed around and returned all over the place. Most especially one that goes by the name xtra
, and is actually used in exactly one place, to add extra context to internal messages (which will be logged).
This whole codebase needs a rethink, piece by piece. I think I need a solid set of extracted unit/API tests before I can really start in on that.
But for now, I'm just gonna add ONE MORE argument to the read-dispatch code.
mode
removed.
responder funcs now take []byte
instead of [][]byte
.
qsplit
gone.
still need to change the config struct to ditch mode.
Mode changes done. Need to fix funcs sigs to handle returning the request AND payload.
ConnReadRaw
needs examining.
And generally get tests working again.
All server tests are passing again. Much rewriting of the low-level code.
Client tests passing, examples are updated, and more changes have been made.
Before closing this, the messaging code needs to be changed to allow nil payloads.