mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-03-23 16:33:35 +08:00
Fix compilation using WITH_OLD_KEEPALIVE
Closes #3250. Thanks to Stefan Bigler
This commit is contained in:
@@ -14,6 +14,7 @@ Broker:
|
||||
Closes #3238.
|
||||
- Fix reporting of client disconnections being incorrectly attributed to "out
|
||||
of memory". Closes #3253.
|
||||
- Fix compilation when using `WITH_OLD_KEEPALIVE`. Closes #3250.
|
||||
|
||||
Client library:
|
||||
- Fix C++ symbols being removed when compiled with link time optimisation.
|
||||
|
||||
@@ -113,6 +113,12 @@ if (WITH_PERSISTENCE)
|
||||
add_definitions("-DWITH_PERSISTENCE")
|
||||
endif (WITH_PERSISTENCE)
|
||||
|
||||
option(WITH_OLD_KEEPALIVE
|
||||
"Use legacy keepalive check mechanism?" OFF)
|
||||
if (WITH_OLD_KEEPALIVE)
|
||||
add_definitions("-DWITH_OLD_KEEPALIVE")
|
||||
endif (WITH_OLD_KEEPALIVE)
|
||||
|
||||
option(WITH_SYS_TREE
|
||||
"Include $SYS tree support?" ON)
|
||||
if (WITH_SYS_TREE)
|
||||
|
||||
@@ -146,15 +146,7 @@ void keepalive__check(void)
|
||||
void keepalive__check(void)
|
||||
{
|
||||
struct mosquitto *context, *ctxt_tmp;
|
||||
time_t timeout;
|
||||
|
||||
if(db.contexts_by_sock){
|
||||
timeout = (last_keepalive_check + 5 - db.now_s);
|
||||
if(timeout <= 0){
|
||||
timeout = 5;
|
||||
}
|
||||
loop__update_next_event(timeout*1000);
|
||||
}
|
||||
if(last_keepalive_check + 5 <= db.now_s){
|
||||
last_keepalive_check = db.now_s;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user