mirror of
https://github.com/schollz/croc.git
synced 2024-11-28 01:16:10 +03:00
Fix bug in relay
This commit is contained in:
parent
cb3f94880d
commit
3bb5f43c07
5
relay.go
5
relay.go
@ -177,7 +177,8 @@ func (r *Relay) clientCommuncation(id int, connection net.Conn) {
|
||||
delete(r.connections.potentialReceivers, key)
|
||||
r.connections.Unlock()
|
||||
logger.Debug("deleted sender and receiver")
|
||||
} else if connectionType == "r" { //receiver connection "r"
|
||||
} else if connectionType == "r" || connectionType == "c" {
|
||||
//receiver
|
||||
if r.connections.IsPotentialReceiverConnected(key) {
|
||||
sendMessage("no", connection)
|
||||
return
|
||||
@ -236,7 +237,7 @@ func receiveMessage(connection net.Conn) string {
|
||||
"ip": connection.RemoteAddr().String(),
|
||||
})
|
||||
messageByte := make([]byte, BUFFERSIZE)
|
||||
err := connection.SetDeadline(time.Now().Add(30 * time.Second))
|
||||
err := connection.SetDeadline(time.Now().Add(60 * time.Minute))
|
||||
if err != nil {
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user