Commit Graph

20 Commits

Author SHA1 Message Date
Matt Joiner bdcba73cf9 Fix race in webtorrent dial stats 2021-05-14 15:42:25 +10:00
Sean DuBois 8749bd9697 Upgrade to pion/webrtc@v3 2021-02-21 13:46:37 -08:00
Shubhendra Singh Chauhan 0cdb33ede0 fixed code quality issues using DeepSource
* Added .deepsource.toml

* Removed empty default in select

* Removed unnecessary use of slice

* Fixed check for empty string
2021-01-30 15:23:49 +11:00
Justin M b6ad979670 Fix panic on Ping/WriteMessage for webtorrent
Introduced in anacrolix/torrent #455
2021-01-17 15:39:59 +11:00
Justin M f33b3ba5ce Ping websocket to ensure connect remains online.
OpenWebTorrent disconnects clients after two minutes of inactivity. In a scenario where an
announce occurs and no other activity occurs for the (default) 120-second idle timer, the
websocket will be torn down by OpenWebTorrent. This in turn causes the tracker client to wait one
minute, reconnect, and reannounce its peers.

This patch sends a websocket.PingMessage every 60 seconds to maintain the connection.
2021-01-06 14:30:01 +11:00
Justin M b2ab540f93 Reannounce webtorrent webrtc offers on reconnect
On socket reconnect, reannounce any webrtc offers that might have been half-open before the
socket reconnected. This implementation closes any existing half-open offers and republishes them,
but does nothing to existing webrtc connections which are still running (these are cleaned up
elsewhere and are not owned by this code)
2021-01-05 11:38:16 +11:00
Matt Joiner c3696aa5a4 Fix race in webtorrent.TrackerClient.Run 2020-06-01 11:11:41 +10:00
Matt Joiner 54d55db108 webtorrent: Synchronize access to PeerConnection.Close 2020-05-03 18:45:12 +10:00
Matt Joiner f36fc10079 Fix crash when announcing unloaded torrent to websocket 2020-05-03 14:10:46 +10:00
Matt Joiner 188aa800b2 Adjust websocket tracker logging levels 2020-04-28 09:14:24 +10:00
Matt Joiner 3226dc1ccd Rename per-torrent ws tracker and output stats 2020-04-22 11:42:31 +10:00
Matt Joiner 0ab6d108be Pool webtorrent tracker websockets at the Client level 2020-04-21 18:08:43 +10:00
Matt Joiner cc69c3ec8f New metrics and log change 2020-04-20 14:00:29 +10:00
Matt Joiner fb6af2a426 Remove unused outbound offer answered field 2020-04-20 14:00:10 +10:00
Matt Joiner c074b30d94 Log webrtc connection errors and rework webtorrent.TrackerClient 2020-04-20 13:42:25 +10:00
Matt Joiner 520d3c38e3 Fix some webtorrent PeerConnection leaks 2020-04-20 10:21:31 +10:00
Matt Joiner d05ce2d274 Update anacrolix/log 2020-04-16 17:20:58 +10:00
Matt Joiner 05e448d132 webtorrent logging improvements 2020-04-13 19:13:23 +10:00
Matt Joiner 93366bb63a Rename webtorrent.NewClient->NewTrackerClient 2020-04-13 19:12:54 +10:00
Matt Joiner e5fd9ede54 Tidy up the webtorrent package, remove buffer 2020-04-13 14:31:39 +10:00