mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
don't dangle
This commit is contained in:
parent
ef25c556a9
commit
5b0c52a97b
1 changed files with 2 additions and 1 deletions
|
@ -162,7 +162,7 @@ func clientCommuncation(port string, c *comm.Comm) (err error) {
|
||||||
// chanFromConn creates a channel from a Conn object, and sends everything it
|
// chanFromConn creates a channel from a Conn object, and sends everything it
|
||||||
// Read()s from the socket to the channel.
|
// Read()s from the socket to the channel.
|
||||||
func chanFromConn(conn net.Conn) chan []byte {
|
func chanFromConn(conn net.Conn) chan []byte {
|
||||||
c := make(chan []byte)
|
c := make(chan []byte, 1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
b := make([]byte, TCP_BUFFER_SIZE)
|
b := make([]byte, TCP_BUFFER_SIZE)
|
||||||
|
@ -181,6 +181,7 @@ func chanFromConn(conn net.Conn) chan []byte {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.Debug("exiting")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return c
|
return c
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue