From 760a61822b92047503f31e13de85467e45b36afe Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Mon, 27 Dec 2010 16:58:46 +0100 Subject: [PATCH] Conf file from CLI, and more ideas. --- README.markdown | 4 ++-- turnip.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.markdown b/README.markdown index 35fb346..300d755 100644 --- a/README.markdown +++ b/README.markdown @@ -25,13 +25,13 @@ curl -d "GET/hello" http://127.0.0.1:7379/ # Ideas, TODO... * Add meta-data info per key (MIME type in a second key, for instance). -* Support PUT, DELETE, HEAD? How? For which commands? +* Support PUT, DELETE, HEAD, OPTIONS? How? For which commands? * Support pub/sub (waiting for HiRedis ticket \#17 in order to add this.) * MULTI/EXEC/DISCARD/WATCH are disabled at the moment; find a way to use them. * Add logging. * Enrich config file: * Provide timeout (this needs to be added to hiredis first.) -* Get config file path from command line. +* Multi-server support, using consistent hashing. * Send your ideas using the github tracker or on twitter [@yowgi](http://twitter.com/yowgi). # HTTP error codes diff --git a/turnip.c b/turnip.c index 097c81c..56e9842 100644 --- a/turnip.c +++ b/turnip.c @@ -50,14 +50,16 @@ on_request(struct evhttp_request *rq, void *ctx) { int main(int argc, char *argv[]) { - (void)argc; - (void)argv; struct server *s = calloc(1, sizeof(struct server)); s->base = event_base_new(); struct evhttp *http = evhttp_new(s->base); - - s->cfg = conf_read("turnip.json"); + + if(argc > 1) { + s->cfg = conf_read(argv[1]); + } else { + s->cfg = conf_read("turnip.json"); + } /* ignore sigpipe */ #ifdef SIGPIPE