Skip to content

Commit

Permalink
Shared subscription support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Mar 14, 2019
1 parent 173b209 commit 8a8d13c
Show file tree
Hide file tree
Showing 7 changed files with 581 additions and 134 deletions.
2 changes: 2 additions & 0 deletions lib/mosquitto_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ struct mosquitto {
time_t disconnect_t;
struct mosquitto__packet *out_packet_last;
struct mosquitto__subhier **subs;
struct mosquitto__subshared_ref **shared_subs;
int sub_count;
int shared_sub_count;
int pollfd_index;
# ifdef WITH_WEBSOCKETS
# if defined(LWS_LIBRARY_VERSION_NUMBER)
Expand Down
15 changes: 15 additions & 0 deletions src/mosquitto_broker_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,25 @@ struct mosquitto__subleaf {
bool retain_as_published;
};


struct mosquitto__subshared_ref {
struct mosquitto__subhier *hier;
struct mosquitto__subshared *shared;
};


struct mosquitto__subshared {
UT_hash_handle hh;
char *name;
struct mosquitto__subleaf *subs;
};

struct mosquitto__subhier {
UT_hash_handle hh;
struct mosquitto__subhier *parent;
struct mosquitto__subhier *children;
struct mosquitto__subleaf *subs;
struct mosquitto__subshared *shared;
struct mosquitto_msg_store *retained;
char *topic;
uint16_t topic_len;
Expand Down Expand Up @@ -397,6 +411,7 @@ struct mosquitto_db{
bool verbose;
#ifdef WITH_SYS_TREE
int subscription_count;
int shared_subscription_count;
int retained_count;
#endif
int persistence_changes;
Expand Down
Loading

0 comments on commit 8a8d13c

Please sign in to comment.