Merge pull request #587 from lucas-clemente/fix-425

close session if reading from the socket fails in the server
This commit is contained in:
Marten Seemann
2017-05-05 16:49:01 +08:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ func (s *server) Serve() error {
// If it does, we only read a truncated packet, which will then end up undecryptable
n, remoteAddr, err := s.conn.ReadFrom(data)
if err != nil {
_ = s.Close()
return err
}
data = data[:n]