Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Commit fd136a8

Browse files
authored
Merge pull request #52 from libp2p/chore/update-deps
call reset where appropriate (and update deps)
2 parents 692dae5 + 7f810d4 commit fd136a8

File tree

3 files changed

+56
-71
lines changed

3 files changed

+56
-71
lines changed

blank.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (bh *BlankHost) NewStream(ctx context.Context, p peer.ID, protos ...protoco
152152

153153
selected, err := mstream.SelectOneOf(protoStrs, s)
154154
if err != nil {
155-
s.Close()
155+
s.Reset()
156156
return nil, err
157157
}
158158

@@ -198,8 +198,8 @@ func (bh *BlankHost) SetStreamHandlerMatch(pid protocol.ID, m func(string) bool,
198198
func (bh *BlankHost) newStreamHandler(s network.Stream) {
199199
protoID, handle, err := bh.Mux().Negotiate(s)
200200
if err != nil {
201-
log.Warning("protocol mux failed: %s", err)
202-
s.Close()
201+
log.Infow("protocol negotiation failed", "error", err)
202+
s.Reset()
203203
return
204204
}
205205

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module github.com/libp2p/go-libp2p-blankhost
33
go 1.14
44

55
require (
6-
github.com/ipfs/go-log v0.0.1
7-
github.com/libp2p/go-eventbus v0.1.0
8-
github.com/libp2p/go-libp2p-core v0.5.3
9-
github.com/multiformats/go-multiaddr v0.2.1
6+
github.com/ipfs/go-log v1.0.4
7+
github.com/libp2p/go-eventbus v0.2.1
8+
github.com/libp2p/go-libp2p-core v0.6.0
9+
github.com/multiformats/go-multiaddr v0.2.2
1010
github.com/multiformats/go-multistream v0.1.1
1111
)

0 commit comments

Comments
 (0)