mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
fix: close http conn correctly
This commit is contained in:
parent
679f46093c
commit
e81fcee208
1 changed files with 2 additions and 2 deletions
4
http.go
4
http.go
|
@ -131,13 +131,13 @@ func (s *HTTPServer) serve(conn net.Conn) {
|
||||||
wg := conc.NewWaitGroup()
|
wg := conc.NewWaitGroup()
|
||||||
wg.Go(func() {
|
wg.Go(func() {
|
||||||
_, err = io.Copy(conn, peer)
|
_, err = io.Copy(conn, peer)
|
||||||
|
_ = conn.Close()
|
||||||
})
|
})
|
||||||
wg.Go(func() {
|
wg.Go(func() {
|
||||||
_, err = io.Copy(peer, conn)
|
_, err = io.Copy(peer, conn)
|
||||||
|
_ = peer.Close()
|
||||||
})
|
})
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
_ = peer.Close()
|
|
||||||
_ = conn.Close()
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue