mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
fix: must close the connection after processing
I think it should help to close #80
This commit is contained in:
parent
af973227e9
commit
bc9c2c8473
1 changed files with 2 additions and 1 deletions
3
http.go
3
http.go
|
@ -140,7 +140,7 @@ func (s *HTTPServer) ListenAndServe(network, addr string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("listen tcp failed: %w", err)
|
return fmt.Errorf("listen tcp failed: %w", err)
|
||||||
}
|
}
|
||||||
|
defer server.Close()
|
||||||
for {
|
for {
|
||||||
conn, err := server.Accept()
|
conn, err := server.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -151,6 +151,7 @@ func (s *HTTPServer) ListenAndServe(network, addr string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
_ = conn.Close()
|
||||||
}(conn)
|
}(conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue