This commit is contained in:
Zack Scholl 2018-09-26 09:14:24 -07:00
parent 1954691f44
commit 113452d459
1 changed files with 5 additions and 5 deletions

View File

@ -136,11 +136,11 @@ func chanFromConn(conn net.Conn) chan []byte {
b := make([]byte, models.TCP_BUFFER_SIZE) b := make([]byte, models.TCP_BUFFER_SIZE)
n, err := reader.Read(b) n, err := reader.Read(b)
if n > 0 { if n > 0 {
c <- b[:n] // c <- b[:n]
// res := make([]byte, n) res := make([]byte, n)
// // Copy the buffer so it doesn't get changed while read by the recipient. // Copy the buffer so it doesn't get changed while read by the recipient.
// copy(res, b[:n]) copy(res, b[:n])
// c <- res c <- res
} }
if err != nil { if err != nil {
c <- nil c <- nil