Age | Commit message (Collapse) | Author |
|
Use the new Buffer APIs from Node v6 for added security. For example,
Buffer.from() will throw if passed a number, unlike Buffer() which
allocated UNINITIALIZED memory.
Use the safe-buffer package for compatibility with previous versions of
Node.js, including v4.x, v0.12, and v0.10.
https://github.com/feross/safe-buffer
|
|
If file is destroyed and stream ends afterwards, then an exception is
thrown because self._torrent is undefined.
|
|
|
|
|
|
|
|
- Support multiple &xs= params in parallel
- Fail on 'error' 'warning' events
|
|
Implement exact source (xs) for magnet URIs
|
|
If a peer disconnects, but the handshake they already sent hasn't been
processed by the wire yet (rare!) then onHandshake could be called
after the peer is destroyed.
At this point self.wire is `null`, so that will get pushed into the
self.swarm.wires array and cause this issue:
https://github.com/feross/webtorrent/issues/792
Closes #792.
|
|
|
|
Private 'infoHash' event allows client.add to check for duplicate
torrents and destroy them before the normal 'infoHash' event is
emitted. Prevents user applications from needing to deal with duplicate
'infoHash' events.
|
|
|
|
Closes #649
Based on a PR by @nkittsteiner. #791
|
|
Add 'noPeers' event to torrents
|
|
Closes #784
|
|
Closes https://github.com/feross/instant.io/issues/109
|
|
|
|
|
|
|
|
|
|
Fix CLI crash
|
|
|
|
|
|
|
|
|
|
|
|
- Only pass `torrent.infoHash` to the Chunk Store constructor, instead
of the `Torrent`
instance itself, to prevent accidental memory leaks of the `Torrent`
object by the
store. (Open an issue if you were using other properties. They can be
re-added.)
- Non-fatal errors with a single torrent will be emitted at
`torrent.on('error')`. You
should listen to this event. Previously, all torrent errors were also
emitted on
`client.on('error')` and handling `torrent.on('error')` was optional.
This design is
better since now it is possible to distinguish between fatal client
errors
(`client.on('error')`) when the whole client becomes unusable versus
recoverable errors
where only a single torrent fails (`torrent.on('error')`) but the
client can continue to
be used. However, if there is no `torrent.on('error')` event, then
the error will be
forwarded to `client.on('error')`. This prevents crashing the client
when the user
only has a listener on the client, but it makes it impossible for
them to determine
a client error versus a torrent error.
- Errors creating a torrent with `client.seed` are now emitted on the
returned `torrent`
object instead of the client (unless there is no event listeners on
`torrent.on('error')` as previously discussed). The torrent object is
now also destroyed
automatically for the user, as was probably expected.
- If `client.get` is passed a `Torrent` instance, it now only returns
it if it is present
in the client.
|
|
|
|
|
|
|
|
### Added
- `client.listening` property to signal whether TCP server is listening
for incoming
connections.
### Changed
- Merged `Swarm` class into `Torrent` object. Properties on
`torrent.swarm` (like
`torrent.swarm.wires`) now exist on `torrent` (e.g. `torrent.wires`).
- `torrent.addPeer` can no longer be called before the `infoHash` event
has been
emitted.
- Remove `torrent.on('listening')` event. Use `client.on('listening')`
instead.
- Remove support from `TCPPool` for listening on multiple ports. This
was not used by
WebTorrent and just added complexity. There is now a single `TCPPool`
instance for the
whole WebTorrent client.
- Deprecate: Do not use `client.download()` anymore. Use `client.add()`
instead.
- Deprecate: Do not use `torrent.swarm` anymore. Use `torrent` instead.
### Fixed
- When there is a `torrent.on('error')` listener, don't also emit
`client.on('error')`.
- Do not return existing torrent object when duplicate torrent is
added. Fire an
`'error'` event instead.
- Memory leak of `Torrent` object caused by `RarityMap`
- Memory leak of `Torrent` object caused by `TCPPool`
- `client.ratio` and `torrent.ratio` are now calculated as `uploaded /
received` instead
of `uploaded / downloaded`.
|
|
Before this, the web seed pipeline length was based on the block size,
just like it is for wire connections, which are block-based.
This meant that we were massively over-estimating the number of http
requests to make to the web seed servers.
Now we use the piece length, since each web seed request is a piece
length in size.
|
|
Max web conns default
|
|
Fixes https://github.com/feross/webtorrent-desktop/issues/311
|
|
Fixes regression introduced in #715
|
|
|
|
|
|
|
|
|
|
|
|
Let the user specify known-good file modtimes. If the files modtime is at least
that old, then the file hasn't changed and does not need to be re-verified.
This is only valid in node when using FS backing storage, not in the browser
|
|
|
|
|
|
|
|
https://github.com/feross/webtorrent-desktop/issues/256
|
|
|
|
|
|
For https://github.com/feross/webtorrent-desktop/issues/256
|
|
This was a source of interval leaks
|
|
|
|
This restores the older timeout for TCP peers, which was originally
increased as a workaround to give enough time for WebRTC peers.
Supersedes https://github.com/feross/bittorrent-swarm/pull/21
|