use ioutil.ReadAll instead of just a plain read"
This commit is contained in:
		
							
								
								
									
										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 { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user