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"
|
"flag"
|
||||||
"github.com/elliotchance/phpserialize"
|
"github.com/elliotchance/phpserialize"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
@ -193,7 +194,7 @@ func handleConnection(conn net.Conn, UC MetadataCache, PC MetadataCache) {
|
||||||
log.Println("handleConnection started")
|
log.Println("handleConnection started")
|
||||||
var buf []byte
|
var buf []byte
|
||||||
var m *MetadataCache
|
var m *MetadataCache
|
||||||
_, err := conn.Read(buf)
|
buf, err := ioutil.ReadAll(conn)
|
||||||
var c cachecommand
|
var c cachecommand
|
||||||
err = json.Unmarshal(buf, &c)
|
err = json.Unmarshal(buf, &c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue