mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
AOF & RDB: be compatible with rdbchecksum no
This commit is contained in:
parent
aba76320d5
commit
edb92db533
@ -2009,10 +2009,11 @@ int rdbLoadRio(rio *rdb, rdbSaveInfo *rsi) {
|
||||
lru_idle = -1;
|
||||
}
|
||||
/* Verify the checksum if RDB version is >= 5 */
|
||||
if (rdbver >= 5 && server.rdb_checksum) {
|
||||
if (rdbver >= 5) {
|
||||
uint64_t cksum, expected = rdb->cksum;
|
||||
|
||||
if (rioRead(rdb,&cksum,8) == 0) goto eoferr;
|
||||
if (server.rdb_checksum) {
|
||||
memrev64ifbe(&cksum);
|
||||
if (cksum == 0) {
|
||||
serverLog(LL_WARNING,"RDB file was saved with checksum disabled: no check performed.");
|
||||
@ -2021,6 +2022,7 @@ int rdbLoadRio(rio *rdb, rdbSaveInfo *rsi) {
|
||||
rdbExitReportCorruptRDB("RDB CRC error");
|
||||
}
|
||||
}
|
||||
}
|
||||
return C_OK;
|
||||
|
||||
eoferr: /* unexpected end of file is handled here with a fatal exit */
|
||||
|
Loading…
x
Reference in New Issue
Block a user