forked from mirror/redcon
do not lcase command
This commit is contained in:
parent
0ec132aed9
commit
8d2bcf15cc
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"log"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/tidwall/redcon"
|
||||
|
@ -16,7 +17,7 @@ func main() {
|
|||
err := redcon.ListenAndServe(addr,
|
||||
func(conn redcon.Conn, commands [][]string) {
|
||||
for _, args := range commands {
|
||||
switch args[0] {
|
||||
switch strings.ToLower(args[0]) {
|
||||
default:
|
||||
conn.WriteError("ERR unknown command '" + args[0] + "'")
|
||||
case "ping":
|
||||
|
|
10
redcon.go
10
redcon.go
|
@ -276,8 +276,7 @@ func handle(
|
|||
}
|
||||
shandler(c, scmds)
|
||||
} else if bhandler != nil {
|
||||
// copy the byte commands once, before exposing to the
|
||||
// client.
|
||||
// copy the byte commands once, before exposing to client.
|
||||
for i := 0; i < len(cmds); i++ {
|
||||
for j := 0; j < len(cmds[i]); j++ {
|
||||
nb := make([]byte, len(cmds[i][j]))
|
||||
|
@ -493,13 +492,6 @@ func (r *reader) ReadCommands() ([][][]byte, error) {
|
|||
}
|
||||
i++
|
||||
arg := b[i : i+ni2]
|
||||
if len(args) == 0 {
|
||||
for j := 0; j < len(arg); j++ {
|
||||
if arg[j] >= 'A' && arg[j] <= 'Z' {
|
||||
arg[j] += 32
|
||||
}
|
||||
}
|
||||
}
|
||||
i += ni2 + 1
|
||||
args = append(args, arg)
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue