Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

log file parsing code improved a bit

  • Loading branch information...
commit 85dd2f3ad232725df668eb9d96553e58e45ad23f 1 parent be2bb6b
@antirez authored
Showing with 9 additions and 13 deletions.
  1. +0 −1  TODO
  2. +9 −12 redis.c
View
1  TODO
@@ -2,7 +2,6 @@ BEFORE REDIS 1.0.0-rc1
- What happens if the saving child gets killed instead to end normally? Handle this.
- Make sinterstore / unionstore / sdiffstore returning the cardinality of the resulting set.
-- Add a new field as INFO output: bgsaveinprogress
- Remove max number of args limit
- GETSET
- network layer stresser in test in demo, make sure to set/get random streams of data and check that what we read back is byte-by-byte the same.
View
21 redis.c
@@ -887,6 +887,12 @@ static long long emptyDb() {
return removed;
}
+static int yesnotoi(char *s) {
+ if (!strcasecmp(s,"yes")) return 1;
+ else if (!strcasecmp(s,"no")) return 0;
+ else return -1;
+}
+
/* I agree, this is a very rudimental way to load a configuration...
will improve later if the config gets more complex */
static void loadServerConfig(char *filename) {
@@ -980,24 +986,15 @@ static void loadServerConfig(char *filename) {
server.masterport = atoi(argv[2]);
server.replstate = REDIS_REPL_CONNECT;
} else if (!strcmp(argv[0],"glueoutputbuf") && argc == 2) {
- sdstolower(argv[1]);
- if (!strcmp(argv[1],"yes")) server.glueoutputbuf = 1;
- else if (!strcmp(argv[1],"no")) server.glueoutputbuf = 0;
- else {
+ if ((server.glueoutputbuf = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
} else if (!strcmp(argv[0],"shareobjects") && argc == 2) {
- sdstolower(argv[1]);
- if (!strcmp(argv[1],"yes")) server.shareobjects = 1;
- else if (!strcmp(argv[1],"no")) server.shareobjects = 0;
- else {
+ if ((server.shareobjects = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
} else if (!strcmp(argv[0],"daemonize") && argc == 2) {
- sdstolower(argv[1]);
- if (!strcmp(argv[1],"yes")) server.daemonize = 1;
- else if (!strcmp(argv[1],"no")) server.daemonize = 0;
- else {
+ if ((server.daemonize = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
} else if (!strcmp(argv[0],"requirepass") && argc == 2) {
Please sign in to comment.
Something went wrong with that request. Please try again.