Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop stream after first pong received #545

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

achingbrain
Copy link
Member

When connecting to go-IPFS from a webworker, the stream opened by the ping protocol is never closed.

The change here uses take to only receive one buffer from the remote node before closing the stream.

When connecting to go-IPFS from a webworker, the stream opened by
the ping protocol is never closed.

The change here uses `take` to only receive one buffer from the
remote node before closing the stream.
Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

LGTM

@jacobheun jacobheun merged commit be8fc9d into master Feb 3, 2020
@jacobheun jacobheun deleted the stop-stream-after-first-pong branch February 3, 2020 14:50
alanshaw pushed a commit to ipfs/js-ipfs that referenced this pull request Feb 3, 2020
Also updates all examples to use the new API.

Depends on:

- [x] ipfs-inactive/interface-js-ipfs-core#581
- [x] ipfs-inactive/js-ipfs-http-client#1226
- [x] libp2p/js-libp2p#545

BREAKING CHANGE:

Where `PeerID`s were previously [CID](https://www.npmjs.com/package/cids)s, now they are Strings

- `ipfs.bitswap.stat().peers[n]` is now a String (was a CID)
- `ipfs.dht.findPeer().id` is now a String (was a CID)
- `ipfs.dht.findProvs()[n].id` is now a String (was a CID)
- `ipfs.dht.provide()[n].id` is now a String (was a CID)
- `ipfs.dht.put()[n].id` is now a String (was a CID)
- `ipfs.dht.query()[n].id` is now a String (was a CID)
- `ipfs.id().id` is now a String (was a CID)
- `ipfs.id().addresses[n]` are now [Multiaddr](https://www.npmjs.com/package/multiaddr)s (were Strings)
github-actions bot pushed a commit to ipfs-examples/js-ipfs-custom-libp2p that referenced this pull request Jun 14, 2021
Also updates all examples to use the new API.

Depends on:

- [x] ipfs-inactive/interface-js-ipfs-core#581
- [x] ipfs-inactive/js-ipfs-http-client#1226
- [x] libp2p/js-libp2p#545

BREAKING CHANGE:

Where `PeerID`s were previously [CID](https://www.npmjs.com/package/cids)s, now they are Strings

- `ipfs.bitswap.stat().peers[n]` is now a String (was a CID)
- `ipfs.dht.findPeer().id` is now a String (was a CID)
- `ipfs.dht.findProvs()[n].id` is now a String (was a CID)
- `ipfs.dht.provide()[n].id` is now a String (was a CID)
- `ipfs.dht.put()[n].id` is now a String (was a CID)
- `ipfs.dht.query()[n].id` is now a String (was a CID)
- `ipfs.id().id` is now a String (was a CID)
- `ipfs.id().addresses[n]` are now [Multiaddr](https://www.npmjs.com/package/multiaddr)s (were Strings)
oliveriosousa pushed a commit to ipfs-examples/js-ipfs-examples that referenced this pull request Jul 26, 2021
Also updates all examples to use the new API.

Depends on:

- [x] ipfs-inactive/interface-js-ipfs-core#581
- [x] ipfs-inactive/js-ipfs-http-client#1226
- [x] libp2p/js-libp2p#545

BREAKING CHANGE:

Where `PeerID`s were previously [CID](https://www.npmjs.com/package/cids)s, now they are Strings

- `ipfs.bitswap.stat().peers[n]` is now a String (was a CID)
- `ipfs.dht.findPeer().id` is now a String (was a CID)
- `ipfs.dht.findProvs()[n].id` is now a String (was a CID)
- `ipfs.dht.provide()[n].id` is now a String (was a CID)
- `ipfs.dht.put()[n].id` is now a String (was a CID)
- `ipfs.dht.query()[n].id` is now a String (was a CID)
- `ipfs.id().id` is now a String (was a CID)
- `ipfs.id().addresses[n]` are now [Multiaddr](https://www.npmjs.com/package/multiaddr)s (were Strings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants