diff --git a/ChangeLog.txt b/ChangeLog.txt index 75a03b188..351eaad16 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,8 @@ Broker: assertions removed. Closes #2708. - Fix default settings incorrectly allowing TLS v1.1. Closes #2722. - Use line buffered mode for stdout. Closes #2354. Closes #2749. +- Fix bridges with non-matching cleansession/local_cleansession being expired + on start after restoring from persistence. Closes #2634. - Fix connections being limited to 2048 on Windows. The limit is now 8192, where supported. Closes #2732. diff --git a/src/persist_write.c b/src/persist_write.c index fb3632fee..f0949f8a2 100644 --- a/src/persist_write.c +++ b/src/persist_write.c @@ -167,11 +167,14 @@ static int persist__client_save(FILE *db_fptr) memset(&chunk, 0, sizeof(struct P_client)); HASH_ITER(hh_id, db.contexts_by_id, context, ctxt_tmp){ - if(context && (context->clean_start == false + if(context && #ifdef WITH_BRIDGE - || (context->bridge && context->bridge->clean_start_local == false) + ((!context->bridge && context->clean_start == false) + || (context->bridge && context->bridge->clean_start_local == false)) +#else + context->clean_start == false #endif - )){ + ){ chunk.F.session_expiry_time = context->session_expiry_time; if(context->session_expiry_interval != 0 && context->session_expiry_interval != UINT32_MAX && context->session_expiry_time == 0){ chunk.F.session_expiry_time = context->session_expiry_interval + db.now_real_s;