From 0adb2ed217ed3f5ee715460c6b711e80f5927953 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 15 Jan 2015 21:57:03 +0000 Subject: [PATCH] [425835] Support for "hour client expiration times. This allows shorter values for the persistent_client_expiration option. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=425835 --- ChangeLog.txt | 2 ++ man/mosquitto.conf.5.xml | 2 +- mosquitto.conf | 4 ++-- src/conf.c | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index bc4b262a..1930ea12 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -53,6 +53,8 @@ Broker: of UNSUBSCRIBE requests to be disabled for topics with "out" direction. Closes bug #456899. - Wildcard TLS certificates are now supported for bridges. +- Support for "hour" client expiration lengths for the + persistent_client_expiration option. Closes bug #425835. Clients: - Both clients can now load default configuration options from a file. diff --git a/man/mosquitto.conf.5.xml b/man/mosquitto.conf.5.xml index 69326ecd..28586d36 100644 --- a/man/mosquitto.conf.5.xml +++ b/man/mosquitto.conf.5.xml @@ -454,7 +454,7 @@ to persistent clients that will never reconnect. This option allows these clients to be removed. The expiration period should be an integer followed - by one of d w m y for day, week, month and year + by one of h d w m y for hour, day, week, month and year respectively. For example: persistent_client_expiration 2m diff --git a/mosquitto.conf b/mosquitto.conf index 4c9203db..5afc12a1 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -91,8 +91,8 @@ # generated client id. This leads to persistent clients that will never # reconnect. This option allows these clients to be removed. # -# The expiration period should be an integer followed by one of d w m y for -# day, week, month and year respectively. For example +# The expiration period should be an integer followed by one of h d w m y for +# hour, day, week, month and year respectively. For example # # persistent_client_expiration 2m # persistent_client_expiration 14d diff --git a/src/conf.c b/src/conf.c index 4b9928e9..e2daf5e1 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1479,6 +1479,9 @@ int _config_read_file_core(struct mqtt3_config *config, bool reload, const char token = strtok_r(NULL, " ", &saveptr); if(token){ switch(token[strlen(token)-1]){ + case 'h': + expiration_mult = 3600; + break; case 'd': expiration_mult = 86400; break;