add quit commands

This commit is contained in:
wenyekui 2014-08-04 11:06:28 +08:00
parent 828b74e2d5
commit 6c88687ebf
2 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,7 @@ var unsopportedCommands = map[string]struct{}{
"slaveof": struct{}{},
"fullsync": struct{}{},
"sync": struct{}{},
"quit": struct{}{},
}
type httpClient struct {

View File

@ -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