Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

fix: use unidirectional streams for v0.4.x #46

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Jun 3, 2020

This PR makes libp2p pubsub subsystem use unidirectional streams instead of bidirectional streams per discussion on ipfs/go-ipfs#7390.

It replicates #45 for the 0.4.x version range of libp2p-pubsub

More details about the reasoning for this can be found in https://discuss.libp2p.io/t/gossip-questions/257/6

@vasco-santos vasco-santos marked this pull request as ready for review June 3, 2020 16:12
@vasco-santos
Copy link
Member Author

Per ipfs/kubo#7390 (comment) this should be ready to go

@@ -82,6 +82,8 @@ class Peer extends EventEmitter {
this.conn = conn
this.stream = pushable({
onEnd: () => {
// close readable side of the stream
this.conn.reset && this.conn.reset()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow-up, I will create an issue to remove this validation and create a wrapper around it-pair for these tests.

it-pair provides a bare minimal duplex stream for testing, but it does not have the reset function, as a multiplex stream. I tested this with js-libp2p and the stream reset function is called there.

@vasco-santos vasco-santos merged commit ec82f5b into v0.4.x Jun 3, 2020
@vasco-santos vasco-santos deleted the fix/use-unidirectional-streams-v0.4.x branch June 3, 2020 19:20
@vasco-santos
Copy link
Member Author

Released on 0.4.5 🚢

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants