From d5b4e4ba60cf83a314c7636317037ce0ce39d927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= Date: Mon, 13 Jul 2015 18:21:16 +0200 Subject: [PATCH] Fix redis : change ending call with "\r\n" --- plugins/redis/redis.go | 4 ++-- plugins/redis/redis_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/redis/redis.go b/plugins/redis/redis.go index 831d74dbe..22f9cb076 100644 --- a/plugins/redis/redis.go +++ b/plugins/redis/redis.go @@ -126,7 +126,7 @@ func (g *Redis) gatherServer(addr *url.URL, acc plugins.Accumulator) error { if addr.User != nil { pwd, set := addr.User.Password() if set && pwd != "" { - c.Write([]byte(fmt.Sprintf("AUTH %s\n", pwd))) + c.Write([]byte(fmt.Sprintf("AUTH %s\r\n", pwd))) r := bufio.NewReader(c) @@ -143,7 +143,7 @@ func (g *Redis) gatherServer(addr *url.URL, acc plugins.Accumulator) error { g.c = c } - g.c.Write([]byte("info\n")) + g.c.Write([]byte("info\r\n")) r := bufio.NewReader(g.c) diff --git a/plugins/redis/redis_test.go b/plugins/redis/redis_test.go index 317fde783..94c52f01b 100644 --- a/plugins/redis/redis_test.go +++ b/plugins/redis/redis_test.go @@ -31,7 +31,7 @@ func TestRedisGeneratesMetrics(t *testing.T) { return } - if line != "info\n" { + if line != "info\r\n" { return } @@ -122,7 +122,7 @@ func TestRedisCanPullStatsFromMultipleServers(t *testing.T) { return } - if line != "info\n" { + if line != "info\r\n" { return }