Commit Graph

12 Commits

Author SHA1 Message Date
Matt Joiner 5f2b09a818
Use netip.AddrPort in PEX code and filter unusable addrs much sooner 2023-05-16 17:55:53 +10:00
Matt Joiner 214fe6b93c
Use webrtc local addr for webrtc conn peer priority
WebRTC conns are providing the correct IP for peer priority calculations, so use that instead of trying to guess (which doesn't work if there are no regular conn listeners attached to the Client.

(cherry picked from commit e86bb5fee3958dc90a3d012469b1352005d6c9ad)
2022-07-12 15:52:03 +10:00
Matt Joiner 12c77bc410 Fix race in TextPexConnState 2021-12-16 14:19:21 +11:00
YenForYang 29638d9e5d
Create default constructor for Client (#567)
Allow for certain values to always be properly initialized on construction -- namely the maps for now. I'm currently working on a change that requires a baseline constructor; this change would make the use of `chansync.BroadcastCond` and `chansync.SetOnce` obsolete -- i.e. one can have channel members without worrying about proper initialization/destruction of a `chan struct{}`.

As for why `makeClient` returns a value instead of a pointer: returning a value gives us more options -- you can always take a pointer from a value later on cheaply, and have things moved to the heap if they weren't already. The same can't be said about getting a value back from a pointer. GC also could potentially have less work to do. Plus I personally find ownership to be an important concept (semi-borrowed from rust) -- use of values make ownership clear.
2021-09-14 23:01:20 +10:00
Matt Joiner 36f52d7a14 Apply next request state asynchronously 2021-06-07 13:01:40 +10:00
Matt Joiner 24ceed61da Break out peerConnWriter 2021-06-07 13:01:40 +10:00
Matt Joiner 47284cf426 Rename Torrent.{add,delete}Connection 2021-05-14 15:39:01 +10:00
Matt Joiner 7f7c59d52e Replace internal/tmproot with Testing.TB.TempDir 2021-02-22 14:30:09 +11:00
Matt Joiner b5215ea7e8 Expose Peer.Network to replace Peer.RemoteAddr.Network 2021-01-25 15:49:48 +11:00
Matt Joiner c1d189ed31 Performance improvements to PEX 2020-10-23 08:58:55 +11:00
Matt Joiner 166f878bdc Fix change in Client.newConnection 2020-04-15 17:28:39 +10:00
Yaroslav Kolomiiets 2b2c480706 PEX: add periodic deltas 2020-04-15 17:24:44 +10:00