From 33f9a2f01e34baf690b565fbc32302c07f1aeac1 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Tue, 6 Sep 2011 21:47:00 +0100 Subject: [PATCH] Disabled Websockets by default. Due to a possible crash, WebSockets are disabled until their implementation is completed. --- client.c | 2 +- conf.c | 2 ++ conf.h | 3 +++ webdis.json | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 7d4e32a..301dc44 100644 --- a/client.c +++ b/client.c @@ -180,7 +180,7 @@ http_client_on_message_complete(struct http_parser *p) { } c->http_version = c->parser.http_minor; - if(p->upgrade) { /* WebSocket, don't execute just yet */ + if(p->upgrade && c->w->s->cfg->websockets) { /* WebSocket, don't execute just yet */ c->is_websocket = 1; return 0; } diff --git a/conf.c b/conf.c index 30d43f6..4717ce2 100644 --- a/conf.c +++ b/conf.c @@ -83,6 +83,8 @@ conf_read(const char *filename) { else conf->verbosity = (log_level)tmp; } else if(strcmp(json_object_iter_key(kv), "daemonize") == 0 && json_typeof(jtmp) == JSON_TRUE) { conf->daemonize = 1; + } else if(strcmp(json_object_iter_key(kv), "websockets") == 0 && json_typeof(jtmp) == JSON_TRUE) { + conf->websockets = 1; } else if(strcmp(json_object_iter_key(kv), "database") == 0 && json_typeof(jtmp) == JSON_INTEGER) { conf->database = json_integer_value(jtmp); } else if(strcmp(json_object_iter_key(kv), "pool_size") == 0 && json_typeof(jtmp) == JSON_INTEGER) { diff --git a/conf.h b/conf.h index af06bb5..93258a4 100644 --- a/conf.h +++ b/conf.h @@ -22,6 +22,9 @@ struct conf { /* daemonize process, off by default */ int daemonize; + /* WebSocket support, off by default */ + int websockets; + /* database number */ int database; diff --git a/webdis.json b/webdis.json index c7c2c06..b1b7181 100644 --- a/webdis.json +++ b/webdis.json @@ -9,6 +9,7 @@ "threads": 3, "daemonize": false, + "websockets": false, "database": 0,