From 113452d4595899b5d4e32471a8caffe30923c9f5 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 26 Sep 2018 09:14:24 -0700 Subject: [PATCH] try fix --- src/tcp/tcp.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index 9e2421e..4b98d22 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -136,11 +136,11 @@ func chanFromConn(conn net.Conn) chan []byte { b := make([]byte, models.TCP_BUFFER_SIZE) n, err := reader.Read(b) if n > 0 { - c <- b[:n] - // res := make([]byte, n) - // // Copy the buffer so it doesn't get changed while read by the recipient. - // copy(res, b[:n]) - // c <- res + // c <- b[:n] + res := make([]byte, n) + // Copy the buffer so it doesn't get changed while read by the recipient. + copy(res, b[:n]) + c <- res } if err != nil { c <- nil