From 01b3e043628669939babd81d057aeed1ebdc6e23 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 15 Dec 2021 00:25:38 +0000 Subject: [PATCH] Rename `remove` to `delete` in external interface. This is consistent with usage in the dynsec plugin. --- include/mosquitto_broker.h | 54 ++++++++++++++++----------------- src/context.c | 2 +- src/database.c | 4 +-- src/handle_connect.c | 2 +- src/handle_unsubscribe.c | 2 +- src/linker-macosx.syms | 10 +++--- src/linker.syms | 10 +++--- src/mosquitto_broker_internal.h | 20 ++++++------ src/plugin_callbacks.c | 20 ++++++------ src/plugin_persist.c | 30 +++++++++--------- src/plugin_public.c | 8 ++--- src/retain.c | 6 ++-- src/session_expiry.c | 2 +- src/subs.c | 2 +- 14 files changed, 86 insertions(+), 86 deletions(-) diff --git a/include/mosquitto_broker.h b/include/mosquitto_broker.h index edfc3628..e497a195 100644 --- a/include/mosquitto_broker.h +++ b/include/mosquitto_broker.h @@ -77,17 +77,17 @@ enum mosquitto_plugin_event { MOSQ_EVT_PERSIST_RESTORE = 12, MOSQ_EVT_PERSIST_CONFIG_ADD = 13, MOSQ_EVT_PERSIST_MSG_ADD = 14, - MOSQ_EVT_PERSIST_MSG_REMOVE = 15, + MOSQ_EVT_PERSIST_MSG_DELETE = 15, MOSQ_EVT_PERSIST_MSG_LOAD = 16, MOSQ_EVT_PERSIST_RETAIN_ADD = 17, - MOSQ_EVT_PERSIST_RETAIN_REMOVE = 18, + MOSQ_EVT_PERSIST_RETAIN_DELETE = 18, MOSQ_EVT_PERSIST_CLIENT_ADD = 19, - MOSQ_EVT_PERSIST_CLIENT_REMOVE = 20, + MOSQ_EVT_PERSIST_CLIENT_DELETE = 20, MOSQ_EVT_PERSIST_CLIENT_UPDATE = 21, MOSQ_EVT_PERSIST_SUBSCRIPTION_ADD = 22, - MOSQ_EVT_PERSIST_SUBSCRIPTION_REMOVE = 23, + MOSQ_EVT_PERSIST_SUBSCRIPTION_DELETE = 23, MOSQ_EVT_PERSIST_CLIENT_MSG_ADD = 24, - MOSQ_EVT_PERSIST_CLIENT_MSG_REMOVE = 25, + MOSQ_EVT_PERSIST_CLIENT_MSG_DELETE = 25, MOSQ_EVT_PERSIST_CLIENT_MSG_UPDATE = 26, MOSQ_EVT_PERSIST_CLIENT_MSG_CLEAR = 27, MOSQ_EVT_PERSIST_CLIENT_MSG_LOAD = 28, @@ -210,7 +210,7 @@ struct mosquitto_evt_persist_restore { void *future[8]; }; -/* Data for the MOSQ_EVT_PERSIST_CLIENT_ADD/_REMOVE/_UPDATE event */ +/* Data for the MOSQ_EVT_PERSIST_CLIENT_ADD/_DELETE/_UPDATE event */ /* NOTE: The persistence interface is currently marked as unstable, which means * it may change in a future minor release. */ struct mosquitto_evt_persist_client { @@ -235,7 +235,7 @@ struct mosquitto_evt_persist_client { }; -/* Data for the MOSQ_EVT_PERSIST_SUBSCRIPTION_ADD/_REMOVE event */ +/* Data for the MOSQ_EVT_PERSIST_SUBSCRIPTION_ADD/_DELETE event */ /* NOTE: The persistence interface is currently marked as unstable, which means * it may change in a future minor release. */ struct mosquitto_evt_persist_subscription { @@ -250,7 +250,7 @@ struct mosquitto_evt_persist_subscription { }; -/* Data for the MOSQ_EVT_PERSIST_CLIENT_MSG_ADD/_REMOVE/_UPDATE event */ +/* Data for the MOSQ_EVT_PERSIST_CLIENT_MSG_ADD/_DELETE/_UPDATE event */ /* NOTE: The persistence interface is currently marked as unstable, which means * it may change in a future minor release. */ struct mosquitto_evt_persist_client_msg { @@ -270,7 +270,7 @@ struct mosquitto_evt_persist_client_msg { }; -/* Data for the MOSQ_EVT_PERSIST_MSG_ADD/_REMOVE/_LOAD event */ +/* Data for the MOSQ_EVT_PERSIST_MSG_ADD/_DELETE/_LOAD event */ /* NOTE: The persistence interface is currently marked as unstable, which means * it may change in a future minor release. */ struct mosquitto_evt_persist_msg { @@ -296,7 +296,7 @@ struct mosquitto_evt_persist_msg { }; -/* Data for the MOSQ_EVT_PERSIST_RETAIN/_REMOVE event */ +/* Data for the MOSQ_EVT_PERSIST_RETAIN/_DELETE event */ /* NOTE: The persistence interface is currently marked as unstable, which means * it may change in a future minor release. */ struct mosquitto_evt_persist_retain { @@ -859,19 +859,19 @@ int mosquitto_persist_client_add(struct mosquitto_evt_persist_client *client); int mosquitto_persist_client_update(struct mosquitto_evt_persist_client *client); -/* Function: mosquitto_persist_client_remove +/* Function: mosquitto_persist_client_delete * - * Use to remove client session for a client from the broker + * Use to delete client session for a client from the broker * * Parameters: - * client_id - the client id of the client to remove + * client_id - the client id of the client to delete * * Returns: * MOSQ_ERR_SUCCESS - on success * MOSQ_ERR_INVAL - if client_id is NULL * MOSQ_ERR_NOT_FOUND - the referenced client is not found */ -int mosquitto_persist_client_remove(const char *client_id); +int mosquitto_persist_client_delete(const char *client_id); /* Function: mosquitto_persist_client_msg_add @@ -903,9 +903,9 @@ int mosquitto_persist_client_remove(const char *client_id); int mosquitto_persist_client_msg_add(struct mosquitto_evt_persist_client_msg *client_msg); -/* Function: mosquitto_persist_client_msg_remove +/* Function: mosquitto_persist_client_msg_delete * - * Use to remove a client message for a particular client. + * Use to delete a client message for a particular client. * * Parameters: * client_msg->plugin_client_id - the client id of the client that the @@ -924,7 +924,7 @@ int mosquitto_persist_client_msg_add(struct mosquitto_evt_persist_client_msg *cl * MOSQ_ERR_INVAL - if client_msg or client_msg->plugin_client_id is NULL * MOSQ_ERR_NOT_FOUND - the client is not found */ -int mosquitto_persist_client_msg_remove(struct mosquitto_evt_persist_client_msg *client_msg); +int mosquitto_persist_client_msg_delete(struct mosquitto_evt_persist_client_msg *client_msg); /* Function: mosquitto_persist_client_msg_update @@ -990,9 +990,9 @@ int mosquitto_persist_client_msg_update(struct mosquitto_evt_persist_client_msg int mosquitto_persist_msg_add(struct mosquitto_evt_persist_msg *msg); -/* Function: mosquitto_persist_msg_remove +/* Function: mosquitto_persist_msg_delete * - * Use to remove a stored message. + * Use to delete a stored message. * * Parameters: * store_id - the stored message ID @@ -1000,7 +1000,7 @@ int mosquitto_persist_msg_add(struct mosquitto_evt_persist_msg *msg); * Returns: * MOSQ_ERR_SUCCESS - on success */ -int mosquitto_persist_msg_remove(uint64_t store_id); +int mosquitto_persist_msg_delete(uint64_t store_id); /* Function: mosquitto_persist_subscription_add @@ -1022,9 +1022,9 @@ int mosquitto_persist_msg_remove(uint64_t store_id); int mosquitto_subscription_add(const char *client_id, const char *topic, uint8_t subscription_options, uint32_t subscription_identifier); -/* Function: mosquitto_persist_subscription_remove +/* Function: mosquitto_persist_subscription_delete * - * Use to remove a subscription for a client + * Use to delete a subscription for a client * * Parameters: * client_id - the client id of the client the new subscription is for @@ -1036,12 +1036,12 @@ int mosquitto_subscription_add(const char *client_id, const char *topic, uint8_t * MOSQ_ERR_NOT_FOUND - the referenced client was not found * MOSQ_ERR_NOMEM - on out of memory */ -int mosquitto_subscription_remove(const char *client_id, const char *topic); +int mosquitto_subscription_delete(const char *client_id, const char *topic); /* Function: mosquitto_persist_retain_add * - * Use to add a retained message. It is not required to remove a retained + * Use to add a retained message. It is not required to delete a retained * message for an existing topic first. * * Parameters: @@ -1059,9 +1059,9 @@ int mosquitto_subscription_remove(const char *client_id, const char *topic); int mosquitto_persist_retain_add(struct mosquitto_evt_persist_retain *retain); -/* Function: mosquitto_persist_retain_remove +/* Function: mosquitto_persist_retain_delete * - * Use to remove a retained message. + * Use to delete a retained message. * * Parameters: * msg->plugin_topic - the topic that the message references @@ -1073,7 +1073,7 @@ int mosquitto_persist_retain_add(struct mosquitto_evt_persist_retain *retain); * MOSQ_ERR_INVAL - if msg or msg->plugin_topic are NULL * MOSQ_ERR_NOMEM - on out of memory */ -int mosquitto_persist_retain_remove(const char *topic); +int mosquitto_persist_retain_delete(const char *topic); #ifdef __cplusplus } diff --git a/src/context.c b/src/context.c index dcf4322d..672e9b0d 100644 --- a/src/context.c +++ b/src/context.c @@ -234,7 +234,7 @@ void context__disconnect(struct mosquitto *context) context__send_will(context); net__socket_close(context); if(context->session_expiry_interval == 0){ - plugin_persist__handle_client_remove(context); + plugin_persist__handle_client_delete(context); /* Client session is due to be expired now */ #ifdef WITH_BRIDGE if(context->bridge == NULL) diff --git a/src/database.c b/src/database.c index 0b083bdd..99ad2d21 100644 --- a/src/database.c +++ b/src/database.c @@ -282,7 +282,7 @@ void db__msg_store_remove(struct mosquitto_msg_store *store, bool notify) db.msg_store_count--; db.msg_store_bytes -= store->payloadlen; if(db.shutdown == false || notify == true){ - plugin_persist__handle_msg_remove(store); + plugin_persist__handle_msg_delete(store); } db__msg_store_free(store); } @@ -330,7 +330,7 @@ static void db__message_remove(struct mosquitto *context, struct mosquitto_msg_d return; } - plugin_persist__handle_client_msg_remove(context, item); + plugin_persist__handle_client_msg_delete(context, item); DL_DELETE(msg_data->inflight, item); if(item->store){ diff --git a/src/handle_connect.c b/src/handle_connect.c index 57b21109..c54a92dc 100644 --- a/src/handle_connect.c +++ b/src/handle_connect.c @@ -186,7 +186,7 @@ int connect__on_authorised(struct mosquitto *context, void *auth_data_out, uint1 if(context->clean_start == true){ sub__clean_session(found_context); found_context->session_expiry_interval = 0; - plugin_persist__handle_client_remove(found_context); + plugin_persist__handle_client_delete(found_context); } if((found_context->protocol == mosq_p_mqtt5 && found_context->session_expiry_interval == 0) || (found_context->protocol != mosq_p_mqtt5 && found_context->clean_start == true) diff --git a/src/handle_unsubscribe.c b/src/handle_unsubscribe.c index f4030d88..48e560f0 100644 --- a/src/handle_unsubscribe.c +++ b/src/handle_unsubscribe.c @@ -130,7 +130,7 @@ int handle__unsubscribe(struct mosquitto *context) log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s", sub); if(allowed){ rc = sub__remove(context, sub, db.subs, &reason); - plugin_persist__handle_subscription_remove(context, sub); + plugin_persist__handle_subscription_delete(context, sub); }else{ rc = MOSQ_ERR_SUCCESS; } diff --git a/src/linker-macosx.syms b/src/linker-macosx.syms index 7ca58e69..433dd5f6 100644 --- a/src/linker-macosx.syms +++ b/src/linker-macosx.syms @@ -22,14 +22,14 @@ _mosquitto_log_printf _mosquitto_malloc _mosquitto_persist_client_add _mosquitto_persist_client_msg_add -_mosquitto_persist_client_msg_remove +_mosquitto_persist_client_msg_delete _mosquitto_persist_client_msg_update -_mosquitto_persist_client_remove +_mosquitto_persist_client_delete _mosquitto_persist_client_update _mosquitto_persist_msg_add -_mosquitto_persist_msg_remove +_mosquitto_persist_msg_delete _mosquitto_persist_retain_add -_mosquitto_persist_retain_remove +_mosquitto_persist_retain_delete _mosquitto_plugin_set_info _mosquitto_property_add_binary _mosquitto_property_add_byte @@ -57,7 +57,7 @@ _mosquitto_sub_matches_acl _mosquitto_sub_matches_acl_with_pattern _mosquitto_sub_topic_check _mosquitto_subscription_add -_mosquitto_subscription_remove +_mosquitto_subscription_delete _mosquitto_topic_matches_sub _mosquitto_topic_matches_sub_with_pattern _mosquitto_validate_utf8 diff --git a/src/linker.syms b/src/linker.syms index 46f44e06..a3cdcd99 100644 --- a/src/linker.syms +++ b/src/linker.syms @@ -23,14 +23,14 @@ mosquitto_malloc; mosquitto_persist_client_add; mosquitto_persist_client_msg_add; - mosquitto_persist_client_msg_remove; + mosquitto_persist_client_msg_delete; mosquitto_persist_client_msg_update; - mosquitto_persist_client_remove; + mosquitto_persist_client_delete; mosquitto_persist_client_update; mosquitto_persist_msg_add; - mosquitto_persist_msg_remove; + mosquitto_persist_msg_delete; mosquitto_persist_retain_add; - mosquitto_persist_retain_remove; + mosquitto_persist_retain_delete; mosquitto_plugin_set_info; mosquitto_property_add_binary; mosquitto_property_add_byte; @@ -58,7 +58,7 @@ mosquitto_sub_matches_acl_with_pattern; mosquitto_sub_topic_check; mosquitto_subscription_add; - mosquitto_subscription_remove; + mosquitto_subscription_delete; mosquitto_topic_matches_sub; mosquitto_topic_matches_sub_with_pattern; mosquitto_validate_utf8; diff --git a/src/mosquitto_broker_internal.h b/src/mosquitto_broker_internal.h index b9746e7d..88a5524c 100644 --- a/src/mosquitto_broker_internal.h +++ b/src/mosquitto_broker_internal.h @@ -166,19 +166,19 @@ struct plugin__callbacks{ struct mosquitto__callback *reload; struct mosquitto__callback *persist_restore; struct mosquitto__callback *persist_client_add; - struct mosquitto__callback *persist_client_remove; + struct mosquitto__callback *persist_client_delete; struct mosquitto__callback *persist_client_update; struct mosquitto__callback *persist_subscription_add; - struct mosquitto__callback *persist_subscription_remove; + struct mosquitto__callback *persist_subscription_delete; struct mosquitto__callback *persist_client_msg_add; - struct mosquitto__callback *persist_client_msg_remove; + struct mosquitto__callback *persist_client_msg_delete; struct mosquitto__callback *persist_client_msg_update; struct mosquitto__callback *persist_client_msg_clear; struct mosquitto__callback *persist_msg_add; - struct mosquitto__callback *persist_msg_remove; + struct mosquitto__callback *persist_msg_delete; struct mosquitto__callback *persist_msg_load; struct mosquitto__callback *persist_retain_add; - struct mosquitto__callback *persist_retain_remove; + struct mosquitto__callback *persist_retain_delete; }; struct mosquitto__security_options { @@ -859,18 +859,18 @@ void plugin__handle_tick(void); int plugin__callback_unregister_all(mosquitto_plugin_id_t *identifier); void plugin_persist__handle_restore(void); void plugin_persist__handle_client_add(struct mosquitto *context); -void plugin_persist__handle_client_remove(struct mosquitto *context); +void plugin_persist__handle_client_delete(struct mosquitto *context); void plugin_persist__handle_client_update(struct mosquitto *context); void plugin_persist__handle_subscription_add(struct mosquitto *context, const char *sub, uint8_t subscription_options, uint32_t subscription_identifier); -void plugin_persist__handle_subscription_remove(struct mosquitto *context, const char *sub); +void plugin_persist__handle_subscription_delete(struct mosquitto *context, const char *sub); void plugin_persist__handle_client_msg_add(struct mosquitto *context, const struct mosquitto_client_msg *cmsg); -void plugin_persist__handle_client_msg_remove(struct mosquitto *context, const struct mosquitto_client_msg *cmsg); +void plugin_persist__handle_client_msg_delete(struct mosquitto *context, const struct mosquitto_client_msg *cmsg); void plugin_persist__handle_client_msg_update(struct mosquitto *context, const struct mosquitto_client_msg *cmsg); void plugin_persist__handle_client_msg_clear(struct mosquitto *context, uint8_t direction); void plugin_persist__handle_msg_add(struct mosquitto_msg_store *msg); -void plugin_persist__handle_msg_remove(struct mosquitto_msg_store *msg); +void plugin_persist__handle_msg_delete(struct mosquitto_msg_store *msg); void plugin_persist__handle_retain_add(struct mosquitto_msg_store *msg); -void plugin_persist__handle_retain_remove(struct mosquitto_msg_store *msg); +void plugin_persist__handle_retain_delete(struct mosquitto_msg_store *msg); /* ============================================================ * Property related functions diff --git a/src/plugin_callbacks.c b/src/plugin_callbacks.c index efb5b504..886a54e5 100644 --- a/src/plugin_callbacks.c +++ b/src/plugin_callbacks.c @@ -93,32 +93,32 @@ static struct mosquitto__callback **plugin__get_callback_base(struct mosquitto__ return &security_options->plugin_callbacks.persist_restore; case MOSQ_EVT_PERSIST_CLIENT_ADD: return &security_options->plugin_callbacks.persist_client_add; - case MOSQ_EVT_PERSIST_CLIENT_REMOVE: - return &security_options->plugin_callbacks.persist_client_remove; + case MOSQ_EVT_PERSIST_CLIENT_DELETE: + return &security_options->plugin_callbacks.persist_client_delete; case MOSQ_EVT_PERSIST_CLIENT_UPDATE: return &security_options->plugin_callbacks.persist_client_update; case MOSQ_EVT_PERSIST_SUBSCRIPTION_ADD: return &security_options->plugin_callbacks.persist_subscription_add; - case MOSQ_EVT_PERSIST_SUBSCRIPTION_REMOVE: - return &security_options->plugin_callbacks.persist_subscription_remove; + case MOSQ_EVT_PERSIST_SUBSCRIPTION_DELETE: + return &security_options->plugin_callbacks.persist_subscription_delete; case MOSQ_EVT_PERSIST_CLIENT_MSG_ADD: return &security_options->plugin_callbacks.persist_client_msg_add; - case MOSQ_EVT_PERSIST_CLIENT_MSG_REMOVE: - return &security_options->plugin_callbacks.persist_client_msg_remove; + case MOSQ_EVT_PERSIST_CLIENT_MSG_DELETE: + return &security_options->plugin_callbacks.persist_client_msg_delete; case MOSQ_EVT_PERSIST_CLIENT_MSG_UPDATE: return &security_options->plugin_callbacks.persist_client_msg_update; case MOSQ_EVT_PERSIST_CLIENT_MSG_CLEAR: return &security_options->plugin_callbacks.persist_client_msg_clear; case MOSQ_EVT_PERSIST_MSG_ADD: return &security_options->plugin_callbacks.persist_msg_add; - case MOSQ_EVT_PERSIST_MSG_REMOVE: - return &security_options->plugin_callbacks.persist_msg_remove; + case MOSQ_EVT_PERSIST_MSG_DELETE: + return &security_options->plugin_callbacks.persist_msg_delete; case MOSQ_EVT_PERSIST_MSG_LOAD: return &security_options->plugin_callbacks.persist_msg_load; case MOSQ_EVT_PERSIST_RETAIN_ADD: return &security_options->plugin_callbacks.persist_retain_add; - case MOSQ_EVT_PERSIST_RETAIN_REMOVE: - return &security_options->plugin_callbacks.persist_retain_remove; + case MOSQ_EVT_PERSIST_RETAIN_DELETE: + return &security_options->plugin_callbacks.persist_retain_delete; default: return NULL; } diff --git a/src/plugin_persist.c b/src/plugin_persist.c index 27942110..71272f3d 100644 --- a/src/plugin_persist.c +++ b/src/plugin_persist.c @@ -109,7 +109,7 @@ void plugin_persist__handle_client_update(struct mosquitto *context) } -void plugin_persist__handle_client_remove(struct mosquitto *context) +void plugin_persist__handle_client_delete(struct mosquitto *context) { struct mosquitto_evt_persist_client event_data; struct mosquitto__callback *cb_base; @@ -122,8 +122,8 @@ void plugin_persist__handle_client_remove(struct mosquitto *context) memset(&event_data, 0, sizeof(event_data)); event_data.client_id = context->id; - DL_FOREACH(opts->plugin_callbacks.persist_client_remove, cb_base){ - cb_base->cb(MOSQ_EVT_PERSIST_CLIENT_REMOVE, &event_data, cb_base->userdata); + DL_FOREACH(opts->plugin_callbacks.persist_client_delete, cb_base){ + cb_base->cb(MOSQ_EVT_PERSIST_CLIENT_DELETE, &event_data, cb_base->userdata); } } @@ -147,7 +147,7 @@ void plugin_persist__handle_subscription_add(struct mosquitto *context, const ch } -void plugin_persist__handle_subscription_remove(struct mosquitto *context, const char *sub) +void plugin_persist__handle_subscription_delete(struct mosquitto *context, const char *sub) { struct mosquitto_evt_persist_subscription event_data; struct mosquitto__callback *cb_base; @@ -158,8 +158,8 @@ void plugin_persist__handle_subscription_remove(struct mosquitto *context, const event_data.client_id = context->id; event_data.topic = sub; - DL_FOREACH(opts->plugin_callbacks.persist_subscription_remove, cb_base){ - cb_base->cb(MOSQ_EVT_PERSIST_SUBSCRIPTION_REMOVE, &event_data, cb_base->userdata); + DL_FOREACH(opts->plugin_callbacks.persist_subscription_delete, cb_base){ + cb_base->cb(MOSQ_EVT_PERSIST_SUBSCRIPTION_DELETE, &event_data, cb_base->userdata); } } @@ -195,7 +195,7 @@ void plugin_persist__handle_client_msg_add(struct mosquitto *context, const stru } -void plugin_persist__handle_client_msg_remove(struct mosquitto *context, const struct mosquitto_client_msg *cmsg) +void plugin_persist__handle_client_msg_delete(struct mosquitto *context, const struct mosquitto_client_msg *cmsg) { struct mosquitto_evt_persist_client_msg event_data; struct mosquitto__callback *cb_base; @@ -218,8 +218,8 @@ void plugin_persist__handle_client_msg_remove(struct mosquitto *context, const s event_data.store_id = cmsg->store->db_id; event_data.direction = cmsg->direction; - DL_FOREACH(opts->plugin_callbacks.persist_client_msg_remove, cb_base){ - cb_base->cb(MOSQ_EVT_PERSIST_CLIENT_MSG_REMOVE, &event_data, cb_base->userdata); + DL_FOREACH(opts->plugin_callbacks.persist_client_msg_delete, cb_base){ + cb_base->cb(MOSQ_EVT_PERSIST_CLIENT_MSG_DELETE, &event_data, cb_base->userdata); } } @@ -301,7 +301,7 @@ void plugin_persist__handle_msg_add(struct mosquitto_msg_store *msg) } -void plugin_persist__handle_msg_remove(struct mosquitto_msg_store *msg) +void plugin_persist__handle_msg_delete(struct mosquitto_msg_store *msg) { struct mosquitto_evt_persist_msg event_data; struct mosquitto__callback *cb_base; @@ -314,8 +314,8 @@ void plugin_persist__handle_msg_remove(struct mosquitto_msg_store *msg) event_data.store_id = msg->db_id; - DL_FOREACH(opts->plugin_callbacks.persist_msg_remove, cb_base){ - cb_base->cb(MOSQ_EVT_PERSIST_MSG_REMOVE, &event_data, cb_base->userdata); + DL_FOREACH(opts->plugin_callbacks.persist_msg_delete, cb_base){ + cb_base->cb(MOSQ_EVT_PERSIST_MSG_DELETE, &event_data, cb_base->userdata); } msg->stored = false; } @@ -339,7 +339,7 @@ void plugin_persist__handle_retain_add(struct mosquitto_msg_store *msg) } -void plugin_persist__handle_retain_remove(struct mosquitto_msg_store *msg) +void plugin_persist__handle_retain_delete(struct mosquitto_msg_store *msg) { struct mosquitto_evt_persist_retain event_data; struct mosquitto__callback *cb_base; @@ -350,7 +350,7 @@ void plugin_persist__handle_retain_remove(struct mosquitto_msg_store *msg) event_data.topic = msg->topic; - DL_FOREACH(opts->plugin_callbacks.persist_retain_remove, cb_base){ - cb_base->cb(MOSQ_EVT_PERSIST_MSG_REMOVE, &event_data, cb_base->userdata); + DL_FOREACH(opts->plugin_callbacks.persist_retain_delete, cb_base){ + cb_base->cb(MOSQ_EVT_PERSIST_MSG_DELETE, &event_data, cb_base->userdata); } } diff --git a/src/plugin_public.c b/src/plugin_public.c index 12b09c0b..88b4f270 100644 --- a/src/plugin_public.c +++ b/src/plugin_public.c @@ -501,7 +501,7 @@ error: } -int mosquitto_persist_client_remove(const char *client_id) +int mosquitto_persist_client_delete(const char *client_id) { struct mosquitto *context; @@ -563,7 +563,7 @@ int mosquitto_persist_client_msg_add(struct mosquitto_evt_persist_client_msg *cl } -int mosquitto_persist_client_msg_remove(struct mosquitto_evt_persist_client_msg *client_msg) +int mosquitto_persist_client_msg_delete(struct mosquitto_evt_persist_client_msg *client_msg) { struct mosquitto *context; @@ -621,7 +621,7 @@ int mosquitto_subscription_add(const char *client_id, const char *topic, uint8_t } -int mosquitto_subscription_remove(const char *client_id, const char *topic) +int mosquitto_subscription_delete(const char *client_id, const char *topic) { struct mosquitto *context; uint8_t reason; @@ -702,7 +702,7 @@ error: } -int mosquitto_persist_msg_remove(uint64_t store_id) +int mosquitto_persist_msg_delete(uint64_t store_id) { struct mosquitto_msg_store *stored; diff --git a/src/retain.c b/src/retain.c index 5ddfefb6..9244662c 100644 --- a/src/retain.c +++ b/src/retain.c @@ -94,7 +94,7 @@ int mosquitto_persist_retain_add(struct mosquitto_evt_persist_retain *msg) -int mosquitto_persist_retain_remove(const char *topic) +int mosquitto_persist_retain_delete(const char *topic) { struct mosquitto_msg_store stored; int rc = MOSQ_ERR_UNKNOWN; @@ -158,7 +158,7 @@ int retain__store(const char *topic, struct mosquitto_msg_store *stored, char ** if(retainhier->retained){ if(persist && retainhier->retained->topic[0] != '$'){ - plugin_persist__handle_retain_remove(retainhier->retained); + plugin_persist__handle_retain_delete(retainhier->retained); } db__msg_store_ref_dec(&retainhier->retained); #ifdef WITH_SYS_TREE @@ -192,7 +192,7 @@ static int retain__process(struct mosquitto__retainhier *branch, struct mosquitt struct mosquitto_msg_store *retained; if(branch->retained->message_expiry_time > 0 && db.now_real_s >= branch->retained->message_expiry_time){ - plugin_persist__handle_retain_remove(branch->retained); + plugin_persist__handle_retain_delete(branch->retained); db__msg_store_ref_dec(&branch->retained); branch->retained = NULL; #ifdef WITH_SYS_TREE diff --git a/src/session_expiry.c b/src/session_expiry.c index 737d0f3e..4f173c9b 100644 --- a/src/session_expiry.c +++ b/src/session_expiry.c @@ -148,7 +148,7 @@ void session_expiry__check(void) context->will_delay_interval = 0; will_delay__remove(context); context__send_will(context); - plugin_persist__handle_client_remove(context); + plugin_persist__handle_client_delete(context); context__add_to_disused(context); }else{ timeout = (item->context->session_expiry_time - db.now_real_s + 1) * 1000; diff --git a/src/subs.c b/src/subs.c index e67b5503..c515249f 100644 --- a/src/subs.c +++ b/src/subs.c @@ -719,7 +719,7 @@ int sub__clean_session(struct mosquitto *context) hier = context->subs[i]->hier; - plugin_persist__handle_subscription_remove(context, context->subs[i]->topic_filter); + plugin_persist__handle_subscription_delete(context, context->subs[i]->topic_filter); if(context->subs[i]->shared){ leaf = context->subs[i]->shared->subs; while(leaf){