Commit Graph

37 Commits

Author SHA1 Message Date
Matt Joiner 1cdae13700 Fix conn status string for WebRTC connections 2020-09-29 16:21:54 +10:00
Matt Joiner 4dee11efe9 Fix panic for unexpected piece rejections
Should fix #419.
2020-09-03 14:34:06 +10:00
Matt Joiner dd906f8fa7 Add ReadExtendedHandshake callback 2020-07-15 16:16:14 +10:00
Matt Joiner 9d0ea15044 Expose peer.RemoteAddr 2020-07-15 16:16:14 +10:00
Matt Joiner 7ee0fdafe3 Add some client callbacks 2020-07-15 16:16:14 +10:00
Matt Joiner 8606385985
Merge pull request #410 from anacrolix/webseeds
* 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
2020-06-03 11:25:08 +10:00
Matt Joiner 8a2ff43246 Tidy up the interface changes 2020-06-02 17:41:59 +10:00
Matt Joiner d5a482e209 Handle webseed request errors 2020-06-02 16:41:49 +10:00
Matt Joiner 7909084a17 Fix webseeds when info isn't available immediately 2020-06-02 16:18:25 +10:00
Maxb d7627143bc Add per-torrent ability to disable uploading 2020-06-02 11:20:39 +10:00
Matt Joiner eb8688a902 Rename fastestConn->fastestPeer 2020-06-01 19:09:17 +10:00
Matt Joiner ff53ab860c Further progress on webseeding 2020-06-01 18:25:45 +10:00
Matt Joiner 317146dec9 Export PeerImpl and all its methods 2020-05-31 13:22:36 +10:00
Matt Joiner 3f8f6e1733 Got things compiling 2020-05-31 13:09:56 +10:00
Matt Joiner 3d1f08b12f Save progress 2020-05-30 17:52:27 +10:00
Matt Joiner de88c620bc Seperate peer and PeerConn 2020-05-30 15:18:28 +10:00
Matt Joiner 02adc3f2ee Break peer out from PeerConn 2020-05-30 10:14:20 +10:00
Matt Joiner 9edd98ad78 Close PeerConn.conn synchronously 2020-05-03 18:40:40 +10:00
Matt Joiner a7b665873c Propagate and log more connection read/write errors now that logging is a bit fancier 2020-05-03 18:40:09 +10:00
Matt Joiner dad5ab89a5 Limit the write buffer to work around a webrtc datachannel issue
https://github.com/pion/datachannel/issues/59. Fixes https://github.com/anacrolix/torrent/issues/402.
2020-05-03 18:39:16 +10:00
Matt Joiner 3e9a5a4aec Expose ClientConfig.Extensions
Also run the storage failure test with fast disabled for the seeder. This probably would have tickled some issues in the past, so it seems like a good place to try it out.
2020-04-23 13:03:40 +10:00
Matt Joiner 86d5ad4b2c Don't delete requests if we're choked per BEP 6
This should make the expected receive chunk counts match up more correctly. It doesn't seem to affect tests at the moment, but then we don't verify the expected receive chunk counts are correct either.
2020-04-23 12:36:19 +10:00
Matt Joiner 12e377e3fe Count expected received chunks instead of flagging them
This can be racy. In the TestReceiveChunkStorageFailure, when we have a storage write failure, we request the chunk again, but the peer has sometimes already sent it, and we return from the connection read loop with unexpected chunk after receiving it twice.
2020-04-23 12:34:43 +10:00
Matt Joiner 4a2802a702 Logging fixes 2020-04-18 17:45:01 +10:00
Matt Joiner d05ce2d274 Update anacrolix/log 2020-04-16 17:20:58 +10:00
Yaroslav Kolomiiets 26071eaad0 PEX: integrate with send throttling 2020-04-16 09:37:38 +10:00
Matt Joiner 3d87c20766 Count outgoing extended messages by extension protocol 2020-04-15 18:09:15 +10:00
Matt Joiner c27e3f8de3 Merge branch 'webtorrent' 2020-04-15 17:26:46 +10:00
Yaroslav Kolomiiets 2b2c480706 PEX: add periodic deltas 2020-04-15 17:24:44 +10:00
Yaroslav Kolomiiets 93430aa01a PEX: add connection tracking 2020-04-15 17:24:44 +10:00
Yaroslav Kolomiiets 634edd2875 Share current connections with peers over PEX (anacrolix#341) 2020-04-15 17:24:44 +10:00
Matt Joiner 8f04efa2db Fix panic in status for webrtc connections 2020-04-13 14:08:32 +10:00
Matt Joiner f45dac1e38 Use offer_id for webrtc conn string 2020-04-13 14:04:34 +10:00
Matt Joiner bae791a5a2 Disable data downloading on storage write errors
Also add a hook and Torrent methods to modify this.
2020-02-22 19:40:50 +11:00
Matt Joiner ddc61845ac Misc cleanup 2020-02-22 19:38:56 +11:00
Matt Joiner ddddc63924 Expose PeerConn.PeerPieces
Fixes #375.
2020-02-21 11:51:24 +11:00
Matt Joiner dff436f102 Rename connection->PeerConn and fix exports 2020-02-21 11:07:50 +11:00