mirror of https://github.com/schollz/croc.git
try fix
This commit is contained in:
parent
42c0240e50
commit
182a9fe2f4
|
@ -136,10 +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 {
|
||||||
res := make([]byte, n)
|
c <- b
|
||||||
// Copy the buffer so it doesn't get changed while read by the recipient.
|
// res := make([]byte, n)
|
||||||
copy(res, b[:n])
|
// // Copy the buffer so it doesn't get changed while read by the recipient.
|
||||||
c <- res
|
// copy(res, b[:n])
|
||||||
|
// c <- res
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c <- nil
|
c <- nil
|
||||||
|
|
Loading…
Reference in New Issue