use ioutil.ReadAll instead of just a plain read"
This commit is contained in:
parent
a2826f5bcf
commit
43a6a202dd
3
main.go
3
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 {
|
||||
|
|
Loading…
Reference in New Issue