From 43a6a202dd0016591568d50572369474e0ce556f Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 18:05:20 -0400 Subject: [PATCH] use ioutil.ReadAll instead of just a plain read" --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ce5e830..ee363f3 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "flag" "github.com/elliotchance/phpserialize" _ "github.com/go-sql-driver/mysql" + "io/ioutil" "log" "net" "os" @@ -193,7 +194,7 @@ func handleConnection(conn net.Conn, UC MetadataCache, PC MetadataCache) { log.Println("handleConnection started") var buf []byte var m *MetadataCache - _, err := conn.Read(buf) + buf, err := ioutil.ReadAll(conn) var c cachecommand err = json.Unmarshal(buf, &c) if err != nil {