fix: must close the connection after processing

I think it should help to close #80
This commit is contained in:
Evsyukov Denis 2024-02-07 20:17:32 +03:00
parent af973227e9
commit bc9c2c8473
No known key found for this signature in database

View file

@ -140,7 +140,7 @@ func (s *HTTPServer) ListenAndServe(network, addr string) error {
if err != nil {
return fmt.Errorf("listen tcp failed: %w", err)
}
defer server.Close()
for {
conn, err := server.Accept()
if err != nil {
@ -151,6 +151,7 @@ func (s *HTTPServer) ListenAndServe(network, addr string) error {
if err != nil {
log.Println(err)
}
_ = conn.Close()
}(conn)
}
}