summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-02-21 17:23:17 +0100
committerantirez <antirez@gmail.com>2019-02-21 17:28:53 +0100
commit3de9ccf190e22f46d6ba7b7167d32ee5c8505bd6 (patch)
tree8bf1aefdbdd9c2a71aa33219ecef2bcaab3892dc /src/config.c
parent624568ae3f842b0cab96569e784fff40bdbfdf8b (diff)
downloadredis-3de9ccf190e22f46d6ba7b7167d32ee5c8505bd6.tar.gz
Gopher: config setting to turn support on/off.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 68a2ea227..8fe5cdbb7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -216,6 +216,10 @@ void loadServerConfigFromString(char *config) {
if ((server.protected_mode = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
+ } else if (!strcasecmp(argv[0],"gopher-enabled") && argc == 2) {
+ if ((server.gopher_enabled = yesnotoi(argv[1])) == -1) {
+ err = "argument must be 'yes' or 'no'"; goto loaderr;
+ }
} else if (!strcasecmp(argv[0],"port") && argc == 2) {
server.port = atoi(argv[1]);
if (server.port < 0 || server.port > 65535) {
@@ -1142,6 +1146,8 @@ void configSetCommand(client *c) {
} config_set_bool_field(
"protected-mode",server.protected_mode) {
} config_set_bool_field(
+ "gopher-enabled",server.gopher_enabled) {
+ } config_set_bool_field(
"stop-writes-on-bgsave-error",server.stop_writes_on_bgsave_err) {
} config_set_bool_field(
"lazyfree-lazy-eviction",server.lazyfree_lazy_eviction) {
@@ -1472,6 +1478,7 @@ void configGetCommand(client *c) {
config_get_bool_field("activerehashing", server.activerehashing);
config_get_bool_field("activedefrag", server.active_defrag_enabled);
config_get_bool_field("protected-mode", server.protected_mode);
+ config_get_bool_field("gopher-enabled", server.gopher_enabled);
config_get_bool_field("repl-disable-tcp-nodelay",
server.repl_disable_tcp_nodelay);
config_get_bool_field("repl-diskless-sync",
@@ -2301,6 +2308,7 @@ int rewriteConfig(char *path) {
rewriteConfigYesNoOption(state,"activerehashing",server.activerehashing,CONFIG_DEFAULT_ACTIVE_REHASHING);
rewriteConfigYesNoOption(state,"activedefrag",server.active_defrag_enabled,CONFIG_DEFAULT_ACTIVE_DEFRAG);
rewriteConfigYesNoOption(state,"protected-mode",server.protected_mode,CONFIG_DEFAULT_PROTECTED_MODE);
+ rewriteConfigYesNoOption(state,"gopher-enabled",server.gopher_enabled,CONFIG_DEFAULT_GOPHER_ENABLED);
rewriteConfigClientoutputbufferlimitOption(state);
rewriteConfigNumericalOption(state,"hz",server.config_hz,CONFIG_DEFAULT_HZ);
rewriteConfigYesNoOption(state,"aof-rewrite-incremental-fsync",server.aof_rewrite_incremental_fsync,CONFIG_DEFAULT_AOF_REWRITE_INCREMENTAL_FSYNC);