Commit 58c8a071 authored by antirez's avatar antirez
Browse files

Fix RESTORE ttl handling in 32 bit archs.

long was used instead of long long in order to handle a 64 bit
resolution millisecond timestamp.

This fixes issue #1483.
parent e1ab2991
...@@ -2959,7 +2959,7 @@ void dumpCommand(redisClient *c) { ...@@ -2959,7 +2959,7 @@ void dumpCommand(redisClient *c) {
/* RESTORE key ttl serialized-value [REPLACE] */ /* RESTORE key ttl serialized-value [REPLACE] */
void restoreCommand(redisClient *c) { void restoreCommand(redisClient *c) {
long ttl; long long ttl;
rio payload; rio payload;
int j, type, replace = 0; int j, type, replace = 0;
robj *obj; robj *obj;
...@@ -2981,7 +2981,7 @@ void restoreCommand(redisClient *c) { ...@@ -2981,7 +2981,7 @@ void restoreCommand(redisClient *c) {
} }
/* Check if the TTL value makes sense */ /* Check if the TTL value makes sense */
if (getLongFromObjectOrReply(c,c->argv[2],&ttl,NULL) != REDIS_OK) { if (getLongLongFromObjectOrReply(c,c->argv[2],&ttl,NULL) != REDIS_OK) {
return; return;
} else if (ttl < 0) { } else if (ttl < 0) {
addReplyError(c,"Invalid TTL value, must be >= 0"); addReplyError(c,"Invalid TTL value, must be >= 0");
...@@ -2989,7 +2989,8 @@ void restoreCommand(redisClient *c) { ...@@ -2989,7 +2989,8 @@ void restoreCommand(redisClient *c) {
} }
/* Verify RDB version and data checksum. */ /* Verify RDB version and data checksum. */
if (verifyDumpPayload(c->argv[3]->ptr,sdslen(c->argv[3]->ptr)) == REDIS_ERR) { if (verifyDumpPayload(c->argv[3]->ptr,sdslen(c->argv[3]->ptr)) == REDIS_ERR)
{
addReplyError(c,"DUMP payload version or checksum are wrong"); addReplyError(c,"DUMP payload version or checksum are wrong");
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment