]> git.saurik.com Git - redis.git/blobdiff - src/config.c
It is now posible to flush all the previous saving points in redis.conf by using...
[redis.git] / src / config.c
index f74f3f9749ab279a3516f72efd1a9502efdbc480..3f713e3e1ccb97d2b2057bf9b971e2533afb8116 100644 (file)
@@ -65,13 +65,17 @@ void loadServerConfigFromString(char *config) {
             if (errno || server.unixsocketperm > 0777) {
                 err = "Invalid socket file permissions"; goto loaderr;
             }
-        } else if (!strcasecmp(argv[0],"save") && argc == 3) {
-            int seconds = atoi(argv[1]);
-            int changes = atoi(argv[2]);
-            if (seconds < 1 || changes < 0) {
-                err = "Invalid save parameters"; goto loaderr;
+        } else if (!strcasecmp(argv[0],"save")) {
+            if (argc == 3) {
+                int seconds = atoi(argv[1]);
+                int changes = atoi(argv[2]);
+                if (seconds < 1 || changes < 0) {
+                    err = "Invalid save parameters"; goto loaderr;
+                }
+                appendServerSaveParams(seconds,changes);
+            } else if (argc == 2 && !strcasecmp(argv[1],"")) {
+                resetServerSaveParams();
             }
-            appendServerSaveParams(seconds,changes);
         } else if (!strcasecmp(argv[0],"dir") && argc == 2) {
             if (chdir(argv[1]) == -1) {
                 redisLog(REDIS_WARNING,"Can't chdir to '%s': %s",
@@ -179,7 +183,7 @@ void loadServerConfigFromString(char *config) {
         } else if (!strcasecmp(argv[0],"slaveof") && argc == 3) {
             server.masterhost = sdsnew(argv[1]);
             server.masterport = atoi(argv[2]);
-            server.replstate = REDIS_REPL_CONNECT;
+            server.repl_state = REDIS_REPL_CONNECT;
         } else if (!strcasecmp(argv[0],"repl-ping-slave-period") && argc == 2) {
             server.repl_ping_slave_period = atoi(argv[1]);
             if (server.repl_ping_slave_period <= 0) {