From a82cd91143afd6b151635adb28b9db6d2c4b2809 Mon Sep 17 00:00:00 2001 From: Negash Date: Tue, 15 Jan 2019 14:55:34 +0300 Subject: [PATCH 1/2] Update Handler.cpp Add EXEC without MULTI --- src/Handler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Handler.cpp b/src/Handler.cpp index b29bdf4..a35c4b2 100644 --- a/src/Handler.cpp +++ b/src/Handler.cpp @@ -639,6 +639,7 @@ bool Handler::preHandleRequest(Request* req, const String& key) return true; case Command::Watch: case Command::Multi: + case Command::Exec: if (!mProxy->supportTransaction()) { directResponse(req, Response::ForbidTransaction); return true; From f304a0cd27b8a4622d262e53e7cc96b1ee1ff890 Mon Sep 17 00:00:00 2001 From: Negash Date: Tue, 15 Jan 2019 14:59:05 +0300 Subject: [PATCH 2/2] Update Conf.cpp Set minArgs/maxArgs = 1 --- src/Conf.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Conf.cpp b/src/Conf.cpp index 7f2d7b9..1406e9b 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -35,8 +35,8 @@ bool ServerConf::parse(ServerConf& s, const char* str) void CustomCommandConf::init(CustomCommandConf&c, const char* name) { c.name = name; - c.minArgs = 2; - c.maxArgs = 2; + c.minArgs = 1; + c.maxArgs = 1; c.mode = Command::Write; } @@ -400,8 +400,8 @@ void Conf::setCustomCommand(const ConfParser::Node* node) CustomCommandConf::init(cc, p->key.c_str()); auto s = p->sub; for (;s ; s = s->next) { - if (setInt(cc.minArgs, "MinArgs", s, 2)) { - } else if (setInt(cc.maxArgs, "MaxArgs", s, 2, 9999)) { + if (setInt(cc.minArgs, "MinArgs", s, 1)) { + } else if (setInt(cc.maxArgs, "MaxArgs", s, 1, 9999)) { } else if (setCommandMode(cc.mode, "Mode", s)) { } else { Throw(UnknownKey, "%s:%d unknown key %s", s->file, s->line, s->key.c_str());