mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
bug fix: increase deadline for reading in channels, addresses #211
This commit is contained in:
parent
a3e81e1d87
commit
3ed036b51d
1 changed files with 1 additions and 1 deletions
|
@ -317,10 +317,10 @@ func (s *server) deleteRoom(room string) {
|
||||||
// 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, 1)
|
c := make(chan []byte, 1)
|
||||||
|
conn.SetReadDeadline(time.Now().Add(3 * time.Hour))
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
b := make([]byte, models.TCP_BUFFER_SIZE)
|
b := make([]byte, models.TCP_BUFFER_SIZE)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
n, err := conn.Read(b)
|
n, err := conn.Read(b)
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue