From 6c88687ebf611b0f79a788adc9b3372509bb30e4 Mon Sep 17 00:00:00 2001 From: wenyekui Date: Mon, 4 Aug 2014 11:06:28 +0800 Subject: [PATCH] add quit commands --- server/client_http.go | 1 + server/client_resp.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/server/client_http.go b/server/client_http.go index b37700e..9a4057b 100644 --- a/server/client_http.go +++ b/server/client_http.go @@ -23,6 +23,7 @@ var unsopportedCommands = map[string]struct{}{ "slaveof": struct{}{}, "fullsync": struct{}{}, "sync": struct{}{}, + "quit": struct{}{}, } type httpClient struct { diff --git a/server/client_resp.go b/server/client_resp.go index 5252c6a..1457b81 100644 --- a/server/client_resp.go +++ b/server/client_resp.go @@ -138,6 +138,11 @@ func (c *respClient) handleRequest(reqData [][]byte) { c.req.cmd = strings.ToLower(ledis.String(reqData[0])) c.req.args = reqData[1:] } + if c.req.cmd == "quit" { + c.req.resp.writeStatus(OK) + c.req.resp.flush() + c.conn.Close() + } req.db = c.db