mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
fix: delete room if full and third-party tries to enter
This commit is contained in:
parent
2131e99826
commit
8250a39534
1 changed files with 1 additions and 1 deletions
|
@ -266,6 +266,7 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if s.rooms.rooms[room].full {
|
if s.rooms.rooms[room].full {
|
||||||
|
defer s.deleteRoom(room)
|
||||||
s.rooms.Unlock()
|
s.rooms.Unlock()
|
||||||
bSend, err = crypt.Encrypt([]byte("room full"), strongKeyForEncryption)
|
bSend, err = crypt.Encrypt([]byte("room full"), strongKeyForEncryption)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -274,7 +275,6 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er
|
||||||
err = c.Send(bSend)
|
err = c.Send(bSend)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
s.deleteRoom(room)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue