-
They now contain sender info of publishes.
-
Only split when they're needed, instead of pre-determining whether I'll need the subtopics. This makes the coming refactor of authentication easier. Also treated user properties with the same brush a bit. Downside: it now always assigns user properties to newly constructed publish objects, even if they are not needed (because the generated packet may only be needed for writing to the client's output buffer). But determining the flow of when and when not they'll be needed is impossible with the coming authentication refactor.
-
It merely drops packets when they exceed it. The specs are unclear about whether you're supposed to delay transmission until the quota is non-negative again. I decided against it because of increased complexity, and because on a continously overloaded client, this makes no sense. Effectively, this formalizes the 'max qos pending' mechanism that was already in place. It also includes PUBACK/PUBREL/PUBCOMP error handling, because that needed to be done for proper quota control.
-
I didn't count the seconds it was already waiting. It does now.
-
This required a special type WillPublish to make this easier and more logical.
-
This allows easier saving of MQTT5 properties, for which a new file version for retained messages is created. It uses the packet parsing logic.
-
- Delay is properly counted from moment of disconnect. - When a session is picked up again, the will is not sent. - An actual fix to what I tried a few commits ago: fix sending will twice. This logic should make storing wills also easier.
-
The loop of pending messages was stuck. We saved a session expiry interval of 0. I may need to change that session copying idea.
-
Also fixes a bug in new interval calculation.
-
And the TODOs are for the next thing: saving the createdAt date.
-
This prevents bugs because the calling context forgets it. A (small) downside is that I have to make the Publish argument non-const. But, that's exactly what it is then, so...
-
Because clients can now also exist as dummy objects, I had to add some extra checks. Also split up handlePublish() and the new parsePublishData().
-
I'm not sure how I'm continueing. I need a safe point.
-
But, this is a safe point before I will refactor it. I will remove the appStartTime and session last touched. With the new queued removals, this is no longer necessary.
-
This saves some allocations. This also meant having to set the C++ standard to 2014. The getCopy() methods of sessions and mqttpackets can't be changed, because of access errors (private).
-
This is a preparation for MQTT5, because when there are receivers and publishers with different protocols, you can't always just write out the same packet. You can sometimes though, so that's what the copy factory determines.
-
When there are many sessions, the copying action can actually take some time, and memory. A vector is faster and uses (a little) less memory. This is a theoretical fix, without benchmarks to support it.
-
Files are simple serialized bytes prefaced by lengths. File is hashed to verify integrity. This was also a good way preventing unexpected errors when trying to crash the parser by having it load a different file. This change includes some refactoring that was necessary: - It 'fixes' looking at the wrong thread's authentiction. This is still wrong though. It will be fixed by a thread local pointer in the next commit. - Deadlocks with yourself are handled in rwlockguard. - QoSPacketQueue is now a class. - Probably other tweaks.