diff --git a/.gx/lastpubver b/.gx/lastpubver index 883807e..c2e0a15 100644 --- a/.gx/lastpubver +++ b/.gx/lastpubver @@ -1 +1 @@ -0.9.13: QmRMgHdiLHJvySrXbtLBehr1W1yTQyuNmZG8HghG54ZPDz +0.9.14: QmaWsab8a1KQgoxWP3RjK7mBhSi5PB9pR6NwZUrSXvVd1i diff --git a/comm.go b/comm.go index 5d05e09..430e6a6 100644 --- a/comm.go +++ b/comm.go @@ -70,7 +70,7 @@ func (p *PubSub) handleSendingMessages(ctx context.Context, s inet.Stream, outgo return bufw.Flush() } - defer s.Close() + defer inet.FullClose(s) for { select { case rpc, ok := <-outgoing: diff --git a/floodsub_test.go b/floodsub_test.go index 54c7d96..28262dd 100644 --- a/floodsub_test.go +++ b/floodsub_test.go @@ -11,8 +11,8 @@ import ( "time" host "github.com/libp2p/go-libp2p-host" - netutil "github.com/libp2p/go-libp2p-netutil" peer "github.com/libp2p/go-libp2p-peer" + swarmt "github.com/libp2p/go-libp2p-swarm/testing" //bhost "github.com/libp2p/go-libp2p/p2p/host/basic" bhost "github.com/libp2p/go-libp2p-blankhost" ) @@ -37,7 +37,7 @@ func getNetHosts(t *testing.T, ctx context.Context, n int) []host.Host { var out []host.Host for i := 0; i < n; i++ { - netw := netutil.GenSwarmNetwork(t, ctx) + netw := swarmt.GenSwarm(t, ctx) h := bhost.NewBlankHost(netw) out = append(out, h) } @@ -777,11 +777,7 @@ func TestPeerDisconnect(t *testing.T) { peers := psubs[0].ListPeers("foo") assertPeerList(t, peers, hosts[1].ID()) for _, c := range hosts[1].Network().ConnsToPeer(hosts[0].ID()) { - streams, err := c.GetStreams() - if err != nil { - t.Fatal(err) - } - for _, s := range streams { + for _, s := range c.GetStreams() { s.Close() } } diff --git a/package.json b/package.json index 978a82e..3546e76 100644 --- a/package.json +++ b/package.json @@ -21,27 +21,21 @@ }, { "author": "whyrusleeping", - "hash": "QmaSfSMvc1VPZ8JbMponFs4WHvF9FgEruF56opm5E1RgQA", + "hash": "QmdHyfNVTZ5VtUx4Xz23z8wtnioSrFQ28XSfpVkdhQBkGA", "name": "go-libp2p-host", - "version": "2.1.8" + "version": "3.0.0" }, { "author": "whyrusleeping", - "hash": "Qma2UuHusnaFV24DgeZ5hyrM9uc4UdyVaZbtn2FQsPRhES", - "name": "go-libp2p-netutil", - "version": "0.3.13" - }, - { - "author": "whyrusleeping", - "hash": "QmYEmPwCBe7ZUFfuymozopHTuF3JXejvJPDAjwtyQCrsDi", + "hash": "QmQ6ASb73YCy77TLfxzKnzQFUyFKMQzDhmjwjaQp6rxK34", "name": "go-libp2p-blankhost", - "version": "0.2.8" + "version": "0.3.0" }, { "author": "whyrusleeping", - "hash": "QmXoz9o2PT3tEzf7hicegwex5UgVP54n3k82K7jrWFyN86", + "hash": "QmYj8wdn5sZEHX2XMDWGBvcXJNdzVbaVpHmXvhHBVZepen", "name": "go-libp2p-net", - "version": "2.0.7" + "version": "3.0.0" }, { "hash": "QmTG23dvpBCBjqQwyDxV8CQT6jmS4PSftNr1VqHhE3MLy7", @@ -65,6 +59,12 @@ "hash": "QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN", "name": "go-libp2p-protocol", "version": "1.0.0" + }, + { + "author": "whyrusleeping", + "hash": "QmPzT3rJnSP8VFP1kw7Ly7HP8AprKNZtwLHXHnxfVSbWT3", + "name": "go-libp2p-swarm", + "version": "3.0.0" } ], "gxVersion": "0.9.0", @@ -72,6 +72,6 @@ "license": "", "name": "go-libp2p-floodsub", "releaseCmd": "git commit -a -m \"gx publish $VERSION\"", - "version": "0.9.13" + "version": "0.9.14" }