firepear / petrel

It's like SQLite, but for networking
MIT License
20 stars 1 forks source link

Remove qsplit and CLI mode #65

Closed firepear closed 1 year ago

firepear commented 2 years ago
firepear commented 2 years 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.

firepear commented 1 year ago

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.

firepear commented 1 year ago

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.

firepear commented 1 year ago

mode removed.

responder funcs now take []byte instead of [][]byte.

qsplit gone.

still need to change the config struct to ditch mode.

firepear commented 1 year ago

Mode changes done. Need to fix funcs sigs to handle returning the request AND payload.

ConnReadRaw needs examining.

And generally get tests working again.

firepear commented 1 year ago

All server tests are passing again. Much rewriting of the low-level code.

firepear commented 1 year ago

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.