Commit 6c196c84 authored by acud's avatar acud Committed by GitHub

libp2p: always close streams (#1282)

parent ef983e69
...@@ -36,6 +36,9 @@ func (s *stream) Headers() p2p.Headers { ...@@ -36,6 +36,9 @@ func (s *stream) Headers() p2p.Headers {
} }
func (s *stream) FullClose() error { func (s *stream) FullClose() error {
// close the stream to make sure it is gc'd
defer s.Close()
if err := s.CloseWrite(); err != nil { if err := s.CloseWrite(); err != nil {
_ = s.Reset() _ = s.Reset()
return err return err
...@@ -60,5 +63,4 @@ func (s *stream) FullClose() error { ...@@ -60,5 +63,4 @@ func (s *stream) FullClose() error {
return err return err
} }
return nil return nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment