]> git.saurik.com Git - redis.git/commitdiff
Fix for replicaiton with over 2GB dump file initial SYNC stage
authorantirez <antirez@gmail.com>
Sat, 6 Mar 2010 11:08:22 +0000 (12:08 +0100)
committerantirez <antirez@gmail.com>
Sat, 6 Mar 2010 11:08:22 +0000 (12:08 +0100)
redis.c

diff --git a/redis.c b/redis.c
index b49de86562190238224613c74e35f2f829b03675..f213b3b1fdc2dbdcdf84308b34ffddbde8c94e94 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -6787,7 +6787,7 @@ static void updateSlavesWaitingBgsave(int bgsaveerr) {
 
 static int syncWithMaster(void) {
     char buf[1024], tmpfile[256], authcmd[1024];
-    int dumpsize;
+    long dumpsize;
     int fd = anetTcpConnect(NULL,server.masterhost,server.masterport);
     int dfd;
 
@@ -6839,8 +6839,8 @@ static int syncWithMaster(void) {
         redisLog(REDIS_WARNING,"Bad protocol from MASTER, the first byte is not '$', are you sure the host and port are right?");
         return REDIS_ERR;
     }
-    dumpsize = atoi(buf+1);
-    redisLog(REDIS_NOTICE,"Receiving %d bytes data dump from MASTER",dumpsize);
+    dumpsize = strtol(buf+1,NULL,10);
+    redisLog(REDIS_NOTICE,"Receiving %ld bytes data dump from MASTER",dumpsize);
     /* Read the bulk write data on a temp file */
     snprintf(tmpfile,256,"temp-%d.%ld.rdb",(int)time(NULL),(long int)random());
     dfd = open(tmpfile,O_CREAT|O_WRONLY,0644);