Logo white

Peter M. Groen / FlashMQ

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • Commits 453
  • Compare
  • Branches 1
  • Tags 0
  • FlashMQ
  • subscriptionstore.cpp
11 May, 2022
2 commits
  • Expire retained messages
    57dadb7e
    Wiebe Cazemier authored
    2022-05-11 19:32:46 +0200  
    Browse File »
  • Efficient client expiration checking ...
    ec40e5b1
    Check events are placed in a sorted map based on the last activity and
    keep-alive interval of the client.
    
    This makes it more accurate and reduces system load because it saves
    unnecessary checking.
    Wiebe Cazemier authored
    2022-05-11 19:31:56 +0200  
    Browse File »

09 May, 2022
1 commit
  • Don't hold two locks while expiring sessions
    e55fbfe4
    Wiebe Cazemier authored
    2022-05-09 16:20:40 +0200  
    Browse File »

06 May, 2022
2 commits
  • Queue wills with second granularity ...
    3aecd638
    There's no point in keeping a vector per nanosecond.
    Wiebe Cazemier authored
    2022-05-06 16:22:01 +0200  
    Browse File »
  • Queue session removal with second granularity ...
    81986902
    There's no point in keeping a vector of removals per nanosecond.
    Wiebe Cazemier authored
    2022-05-06 16:21:55 +0200  
    Browse File »

05 May, 2022
3 commits
  • Queue wills in ordered map ...
    b18af18a
    This is fast(er).
    Wiebe Cazemier authored
    2022-05-05 22:14:50 +0200  
    Browse File »
  • Fix broken lock guards
    71ffc7d5
    Wiebe Cazemier authored
    2022-05-05 22:14:50 +0200  
    Browse File »
  • Use ordered map for session removals ...
    20b1d0a0
    This is way faster.
    Wiebe Cazemier authored
    2022-05-05 22:14:50 +0200  
    Browse File »

02 May, 2022
1 commit
  • Improve logging wrt to session expiration
    f3a196e3
    Wiebe Cazemier authored
    2022-05-02 21:16:21 +0200  
    Browse File »

01 May, 2022
20 commits
  • Flow control based on receive maximum ...
    7870dc8a
    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.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Implement extended authentication ...
    569b87ee
    This also contains some fixes/unifications for traditional
    authentication, error handling specifically.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Disconnect clients with good reason code ...
    d125dc49
    On server shutdown and when taking over a session.
    
    On disconnect, wills are queued first, we wait for the queueing to be done, then
    initiate disconnect.
    
    When TCP buffers are full and fds are not reported by epoll, the thread
    loop still exits and clients are just closed on exit.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Fix resetting session expire timeout on reloading state ...
    3f53ee96
    I didn't count the seconds it was already waiting. It does now.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Support saving wills into the session db ...
    ebe7c845
    This required a special type WillPublish to make this easier and more
    logical.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Use 'Publish' for retained instead of 'MqttPacket' ...
    1bca4cbb
    This is better in line with how the copy factory is meant to be used. It
    actually broke on the assert on 'externallyReceived' before.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Allow wills to be retained
    6158d91b
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Convert to storing Publish object for retained message ...
    75657bf5
    This allows easier saving of MQTT5 properties, for which a new file
    version for retained messages is created. It uses the packet parsing logic.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Fix various will things ...
    9c61bff7
    - 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.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Defined a reason code for many errors ...
    193f509d
    I think it's very hard to distinguish between protocol error and
    malformed packet. It's kind of arbitrary...
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Load and store createdAt time of stored QoS packets ...
    ec518d7a
    Also fixes a bug in new interval calculation.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Check for publish message expiration
    03fd22bd
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Replace app start time with queued session removal
    34929680
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Untested new format of saving sessions ...
    16119952
    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.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Deal with empty session for early client disconnect
    39c1873d
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Queue session removals ...
    96c1dd91
    This replaces the old style checking of expired sessions once every 10
    minutes or so.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • The new will structure, with delays, works
    4cd9300c
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • it compiles
    52efbdc7
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Change clean session into MQTT5 symantics ...
    9a34fc46
    The behavior for MQTT3 clients in the same, but I replaced the term
    'clean session' and described the behavior in MQTT5 terms, of 'clean
    start' and an expiry interval.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »
  • Start mqtt5 by the connect properties ...
    a682f1e0
    Most of it is limits we already implemented non-standard compliant.
    Wiebe Cazemier authored
    2022-05-01 17:32:10 +0200  
    Browse File »

06 Mar, 2022
1 commit
  • Use std::make_shared and std::make_unique ...
    57b89866
    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).
    Wiebe Cazemier authored
    2022-03-06 11:41:24 +0100  
    Browse File »

01 Mar, 2022
1 commit
  • Change writing packets to clients to writing PublishCopyFactory ...
    ecb60b48
    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.
    Wiebe Cazemier authored
    2022-03-01 10:13:15 +0100  
    Browse File »

22 Feb, 2022
1 commit
  • Fix sending wrong downgraded QoS retained messages
    6081679b
    Wiebe Cazemier authored
    2022-02-22 21:53:41 +0100  
    Browse File »

14 Feb, 2022
1 commit
  • Add subscription count in $SYS
    81fcc49d
    Wiebe Cazemier authored
    2022-02-14 20:19:51 +0100  
    Browse File »

12 Feb, 2022
1 commit
  • Fix not downgrading QoS to subscription QoS ...
    f67238c5
    This entails making copies of the original packet when necessary,
    because QoS 0 doesn't have a packet id. I tried to keep it to an
    absolute minimum and do some precarious optmizations for it. There are
    tests though.
    Wiebe Cazemier authored
    2022-02-12 18:14:23 +0100  
    Browse File »

24 Nov, 2021
5 commits
  • Don't save sessions from 'clean session' clients
    1907e5f5
    Wiebe Cazemier authored
    2021-11-24 20:22:05 +0100  
    Browse File »
  • Use destructors to unlock locks when saving to disk ...
    1b3c90ae
    Functionally, this doesn't change anything.
    Wiebe Cazemier authored
    2021-11-24 20:22:05 +0100  
    Browse File »
  • Publish retained messages outside of retainedMessagesRwlock
    4d4e0ec5
    Wiebe Cazemier authored
    2021-11-24 20:22:05 +0100  
    Browse File »
  • Publish retained messages out of subscriptions lock ...
    9dc1e6ed
    When clients connect, they get the retained messages. There is no need
    to do that while holding the subscriptions lock.
    Wiebe Cazemier authored
    2021-11-24 20:22:05 +0100  
    Browse File »
  • Write to session/client outside of subscription lock
    b615099f
    Wiebe Cazemier authored
    2021-11-24 20:22:05 +0100  
    Browse File »

22 Nov, 2021
1 commit
  • Remove the correct session
    60e64cf9
    Wiebe Cazemier authored
    2021-11-22 19:09:58 +0100  
    Browse File »