mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-05 00:08:06 +08:00
Improve p2p stream closing in http proxy
License: MIT Signed-off-by: Ian Preston <ianopolous@protonmail.com>
This commit is contained in:
parent
6e24fc609a
commit
d30c41a5e0
@ -95,7 +95,11 @@ type respBody struct {
|
||||
|
||||
// Closes the response's body and the connection.
|
||||
func (rb *respBody) Close() error {
|
||||
rb.stream.Close()
|
||||
if err := rb.stream.Close(); err != nil {
|
||||
rb.stream.Reset()
|
||||
} else {
|
||||
go inet.AwaitEOF(rb.stream)
|
||||
}
|
||||
return rb.ReadCloser.Close()
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user