fix: close http conn correctly

This commit is contained in:
Evsyukov Denis 2024-02-09 14:11:49 +03:00
parent 679f46093c
commit e81fcee208
No known key found for this signature in database

View file

@ -131,13 +131,13 @@ func (s *HTTPServer) serve(conn net.Conn) {
wg := conc.NewWaitGroup()
wg.Go(func() {
_, err = io.Copy(conn, peer)
_ = conn.Close()
})
wg.Go(func() {
_, err = io.Copy(peer, conn)
_ = peer.Close()
})
wg.Wait()
_ = peer.Close()
_ = conn.Close()
}()
}