mirror of
https://github.com/fluencelabs/redis
synced 2025-06-24 06:21:32 +00:00
RDB: try to make error handling code more readable.
This commit is contained in:
@ -212,19 +212,20 @@ int redis_check_rdb(char *rdbfilename, FILE *fp) {
|
||||
|
||||
/* Handle special types. */
|
||||
if (type == RDB_OPCODE_EXPIRETIME) {
|
||||
time_t t;
|
||||
rdbstate.doing = RDB_CHECK_DOING_READ_EXPIRE;
|
||||
/* EXPIRETIME: load an expire associated with the next key
|
||||
* to load. Note that after loading an expire we need to
|
||||
* load the actual type, and continue. */
|
||||
if (rdbLoadTime(&rdb, &t) == C_ERR) goto eoferr;
|
||||
expiretime = t * 1000;
|
||||
expiretime = rdbLoadTime(&rdb);
|
||||
expiretime *= 1000;
|
||||
if (rioGetReadError(&rdb)) goto eoferr;
|
||||
continue; /* Read next opcode. */
|
||||
} else if (type == RDB_OPCODE_EXPIRETIME_MS) {
|
||||
/* EXPIRETIME_MS: milliseconds precision expire times introduced
|
||||
* with RDB v3. Like EXPIRETIME but no with more precision. */
|
||||
rdbstate.doing = RDB_CHECK_DOING_READ_EXPIRE;
|
||||
if (rdbLoadMillisecondTime(&rdb, &expiretime, rdbver) == C_ERR) goto eoferr;
|
||||
expiretime = rdbLoadMillisecondTime(&rdb, rdbver);
|
||||
if (rioGetReadError(&rdb)) goto eoferr;
|
||||
continue; /* Read next opcode. */
|
||||
} else if (type == RDB_OPCODE_FREQ) {
|
||||
/* FREQ: LFU frequency. */
|
||||
|
Reference in New Issue
Block a user