Closed ryan-summers closed 1 year ago
@jordens This is ready for an initial review, but I'm going to add some more testing around the ring buffer and republication semantics. I'd love to get your opinion on the implementation though.
This should now have all the kinks worked out. I gave it a spin on stabilizer just to be sure, although that isn't using any of the QoS stuff
@jordens Ping on this - it should be ready to go now
Yeah that technically works just fine. There's a little less protection against code defects though because we never check the republication buffer, so it's possible that a defect that corrupts the buffer may mess with our republication state.
However, if that happened, we'd cause protocol errors on the TCP socket and everything would reset anyways, so it's likely not a big deal. It's not updated.
This PR fixes #92 by refactoring the session state to use a singular ring buffer supplied by the user for maintaining republication state.
This should reduce code size and RAM memory footprint.
Now, the session state is backed primarily with a user-provided
session
buffer. This buffer is used for storingpublish
messages with QoS > 0 until they are acked.