Skip to content

Commit

Permalink
Fix server open connection leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tengattack committed Jan 3, 2021
1 parent 58f5edc commit 84b1d45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ func (s *server) handle(client net.Conn) {
go func() {
var buf [1]byte
if _, err := io.ReadFull(client, buf[:]); err != nil {
close(sig)
client.Close()
return
}
close(sig)
Expand Down

0 comments on commit 84b1d45

Please sign in to comment.