* Allow Storage Backends to do their own Hashing
- Describes an optional interface 'SelfHashing' that a storage backend's type implementing 'PieceImpl' may also implement in order to calculate piece hashsums itself.
- Alters the 'hashPiece' function in the torrent package to look for types implementing 'SelfHashing' . If not implemented, calculate the hash as usual.
This fixes the limitation that the max outstanding requests for a webseed peer must match the request concurrency. It should mean less recalculation, and more pipelining.
It was incorrect to assume piece hashing only operates on incomplete chunk data. This actually uncovered a bug where duplicate hash checks occurred, and the redundant checks would fail due to not reading the completed data.
Chunk write errors to storage can disable data download. Previously Readers would wait indefinitely for the data to become available. This change returns an error instead of stalling.
* Rename Peer to PeerInfo, and unexport PeerInfos
* Break peer out from PeerConn
* Abstract out segments mapping and use it in mmap storage
* Got file storage working with segment index
* Fix race in webtorrent.TrackerClient.Run
* storage file implementation: Error on short writes
* Remove debug logging from storage file implementation
* cmd/torrent-verify: Fix piece hash output
* Support disabling webtorrent
* Further progress on webseeding
* Handle webseed Client events
* Rename fastestConn->fastestPeer
* Add webseeds from magnet links
* Remove events from webseed
Manage this stuff inside the webseed peer instead.
* Make use of magnet source fields and expose Torrent.MergeSpec
* Add option to disable webseeds
* Fix webseeds when info isn't available immediately
* Handle webseed request errors
* Tidy up the interface changes