From 47ea2b93243d86aa1c223ff0f3607ce17b515d71 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sat, 20 Feb 2016 22:35:26 +0100 Subject: [PATCH] And the fix wasn't right --- broker/clients.go | 4 ++-- tg/client.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/broker/clients.go b/broker/clients.go index 5789d4b..d93687f 100644 --- a/broker/clients.go +++ b/broker/clients.go @@ -46,10 +46,10 @@ func handleClient(c net.Conn) { // Get command var cmd tg.ClientCommand - err = json.Unmarshal(bytes, &cmd) + err = json.Unmarshal(buf, &cmd) if err != nil { log.Printf("[handleClient] Can't parse JSON: %s\r\n", err.Error()) - log.Printf("%s\n", string(bytes)) + log.Printf("%s\n", string(buf)) continue } diff --git a/tg/client.go b/tg/client.go index abbfae8..c82689a 100644 --- a/tg/client.go +++ b/tg/client.go @@ -39,7 +39,7 @@ func CreateBrokerClient(brokerAddr string, updateFn UpdateHandler) error { err = json.Unmarshal(buf, &update) if err != nil { log.Printf("[tg - CreateBrokerClient] ERROR reading JSON: %s\r\n", err.Error()) - log.Printf("%s\n", string(bytes)) + log.Printf("%s\n", string(buf)) continue }