Skip to content

Commit

Permalink
Fix check when loading persistence file of a different version
Browse files Browse the repository at this point in the history
Closes #1684. Thanks to grekhss.
  • Loading branch information
ralight committed May 15, 2020
1 parent 762ad43 commit eae8c9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Broker:
- Don't disconnect clients that are already disconnected. This prevents the
session expiry being extended on SIGHUP. Closes #1521.
- Fix support for openssl 3.0.
- Fix check when loading persistence file of a different version than the
native version. Closes #1684.

Client library:
- Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error.
Expand Down
2 changes: 1 addition & 1 deletion src/persist_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ int persist__restore(struct mosquitto_db *db)
/* IMPORTANT - this is where compatibility checks are made.
* Is your DB change still compatible with previous versions?
*/
if(db_version > MOSQ_DB_VERSION && db_version != 0){
if(db_version != MOSQ_DB_VERSION){
if(db_version == 4){
}else if(db_version == 3){
/* Addition of source_username and source_port to msg_store chunk in v4, v1.5.6 */
Expand Down

0 comments on commit eae8c9a

Please sign in to comment.