Commit 13bf053a authored by Janos Guljas's avatar Janos Guljas

do not use FullClose for closing libp2p Streams

parent b1e1d052
...@@ -108,7 +108,7 @@ func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error) { ...@@ -108,7 +108,7 @@ func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error) {
s.host.SetStreamHandlerMatch(id, matcher, func(s network.Stream) { s.host.SetStreamHandlerMatch(id, matcher, func(s network.Stream) {
ss.Handler(p2p.Peer{ ss.Handler(p2p.Peer{
Addr: s.Conn().RemoteMultiaddr(), Addr: s.Conn().RemoteMultiaddr(),
Stream: stream{s}, Stream: s,
}) })
}) })
} }
...@@ -155,13 +155,5 @@ func (s *Service) NewStream(ctx context.Context, peerID, protocolName, streamNam ...@@ -155,13 +155,5 @@ func (s *Service) NewStream(ctx context.Context, peerID, protocolName, streamNam
} }
return nil, fmt.Errorf("create stream %q to %q: %w", swarmStreamName, peerID, err) return nil, fmt.Errorf("create stream %q to %q: %w", swarmStreamName, peerID, err)
} }
return stream{st}, nil return st, nil
}
type stream struct {
network.Stream
}
func (s stream) Close() error {
return helpers.FullClose(s)
} }
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