Commit Graph

167 Commits (331e8029131e2108eee5984788036ec818158525)

Author SHA1 Message Date
Roger A. Light 331e802913 Rename mosquitto_client_msg -> mosquitto__client_msg 3 years ago
Roger A. Light 100fd31530 Refactor base_msg structs. 3 years ago
Roger A. Light c1edce8df8 Plugin loading. 3 years ago
Roger A. Light 514f8dc89a Extend protocol edge-case test suite. 3 years ago
Kai Buschulte 32588f45ab Introduce subs_count for client subscriptions
This is the actual number of subscriptions.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Kai Buschulte 31cdd26230 Rename sub_count to subs_capacity
sub_count is not the actual number of subscriptions.
Renamed it to subs_capacity, as it keeps the value of allocated
mosquitto__client_sub elements stored in the subs member of the
mosquitto struct.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Roger A. Light b11b0b206c Function naming consistency 3 years ago
Roger A. Light fd68bf00c7 Merge branch 'master' into develop 3 years ago
Roger A. Light 7917553eb2 Fix expired messages causing queued messages not to be delivered.
Closes #2609. Thanks to JSchy65.
3 years ago
Roger A. Light 351911bd8f Fix incorrect return code being sent in DISCONNECT.
This is for when a client session is taken over.

Closes #2607. Thanks to der-b
3 years ago
Roger A. Light 4093e717f9 Minor refactor 3 years ago
Roger A. Light 09ac578459 Fix unused flags in CONNECT command being forced to be 0 in MQTT v3.1
This check is not required until v3.1.1.

Closes #2522. Thanks to garinocyr
3 years ago
Roger A. Light c985736866 Restrict persistence events to persisted clients only. 4 years ago
Roger A. Light 2d3b152a22 Rename of mosquitto_msg_store struct.
struct mosquitto_msg_store -> struct mosquitto_base_msg

This is the base message which client messages and retained messages
refer to. The base messages are still held in the message store.

This change comes about because the persistence interface exposes these
message types. Prior to this commit the different messages were "msg",
"client_msg", and "retain". After this commit there is "base_msg",
"client_msg", and and "retain_msg" in the persist interface.
4 years ago
Roger A. Light 500542351d Set pointers to NULL after freeing. 4 years ago
Roger A. Light 9578a38f79 Fix possible socket leak
This affects clients that connect but do not send a full CONNECT packet.
4 years ago
Roger A. Light 01b3e04362 Rename `remove` to `delete` in external interface.
This is consistent with usage in the dynsec plugin.
4 years ago
Roger A. Light 0f8733627a Plugin persistence interface. 4 years ago
Roger Light cd07f1136b Bump copyrights. 4 years ago
Roger A. Light 8ac11929cc Merge branch 'master' into develop 4 years ago
Roger Light 9d3f292b39 Send DISCONNECT With session-takeover return code.
This is for MQTT v5 clients when a client connects with the same client id.

Closes #2340. Thanks to hvxl.
4 years ago
Roger Light 4cb811a0b6 Add more basic auth rejection options for plugins. 4 years ago
Roger A. Light 799cdead15 Experimental custom websockets support. 4 years ago
Roger A. Light be80a3f4d0 Fix client id not showing in log on failed connections, where possible. 4 years ago
Roger Light 07f793a108 Fix protocol checks - bridge and CONNACK responses. 4 years ago
Roger A. Light ba936a869d Add `accept_protocol_versions` option. 4 years ago
Roger A. Light 02685d49b6 Add `global_max_clients` option.
This allows limiting client sessions globally on the broker.
4 years ago
Roger A. Light aa29b45e70 Merge branch 'master' into develop 4 years ago
Roger A. Light 37b5aedcb6 Fix for #575314.
Incoming QoS 2 messages that had not completed the QoS flow were not being
checked for ACL access when a clean session=False client was reconnecting.

Closes #575314.
4 years ago
Roger Light 32af599c81 Fix $share subscriptions not being recovered for durable clients.
If a plugin had granted ACL subscription access to a
durable/non-clean-session client, then removed that access, the client would
keep its existing subscription. This has been fixed.
4 years ago
Roger Light ba2ca33671 Strict protocol compliance fixes, and extensive test suite. 4 years ago
Roger Light 93b2232bb9 Apply max_keepalive to MQTT v3.1.1 and v3.1 clients. 4 years ago
Roger Light 114588fff8 Log protocol version and ciphers that a client negotiates when connecting. 4 years ago
Roger A. Light 49065f03a8 Merge remote-tracking branch 'origin/fixes' into develop 4 years ago
Roger A. Light 42163634c7 Fix leak on crafted MQTT v5 CONNECT.
If a MQTT v5 client connects with a crafted CONNECT packet a memory leak
will occur.

Thanks to Kathrin Kleinhammer.
4 years ago
Roger A. Light 906a515704 Simplify client message properties, only one is used. 4 years ago
Roger A. Light 0d3870585b Plugin delayed authentication. 4 years ago
Roger A. Light 8a03b5ad5c Function for checking if a context is connected. 4 years ago
Roger Light ef7662ca8e Merge branch 'master' into develop 4 years ago
Roger Light 2de8c15bc9 Minor build fixes. 5 years ago
Roger Light a6bb8d3611 Don't over write new receive-maximum if a v5 client connects.
This is for when it takes over an old session.

Closes #2134. Thanks to Frantisek Fuka.
5 years ago
Roger A. Light 891be8c2fe Fix `max_keepalive` option not applying to keepalive=0.
Closes #2117. Thanks to David Nadlinger.
5 years ago
Roger A. Light fd036b9435 Merge branch 'fixes' into develop 5 years ago
Roger A. Light 7a3b69f2d7 Fix possible leak during connect.
Closes #2057. Thanks to Przemysław Zygmunt.
5 years ago
Roger A. Light 706a1f3f29 Fix more minor compiler warnings. 5 years ago
Roger A. Light a4389fc9ce Fix SPDX identifiers: EDL-1.0 -> BSD-3-Clause.
The two licenses are the same.
5 years ago
Roger A. Light 3c58ac9308 Fix `message_size_limit` not applying to the Will payload.
Closes #2022. Thanks to Umberto Morelli.
5 years ago
Roger A. Light 0087431bf4 Add MOSQ_EVT_CONNECT event.
This allows plugins to know when a client has successfully authenticated
to the broker.

Add connection-state example plugin to demonstrate MOSQ_EVT_CONNECT.
5 years ago
Roger Light 113603168b Fix LWT not being sent on client takeover.
This was not happening for the case when the existing session wasn't
being continued.

Closes #1946. Thanks to Rory Piper.
5 years ago
Roger A. Light 232a759320 Log client port on new connections.
Closes #1911. Thanks to twegener-embertec.
5 years ago