Commit graph

40 commits

Author SHA1 Message Date
Jimmy Zelinskie
938542ac74 models: Announce field for AnnounceResponse 2015-04-04 15:42:28 -04:00
Jimmy Zelinskie
222415f467 udp: Implement draft of BEP45; Endpoint type added
Because of the requirement of storing multiple ports, Announce.Port has
been abolished and Announce.IPv4/IPv6 have been replaced with the
Endpoint type. HTTP has been updated to support this model. UDP has been
updated to support the latest draft of BEP45 and most of the
optional-types described in BEP41.
2015-03-29 03:03:19 -04:00
Jimmy Zelinskie
f25464a02b Merge branch 'master' into udp 2015-03-27 22:05:48 -04:00
Jimmy Zelinskie
b93cc26b98 models: properly format port into peerkey string 2015-03-26 22:11:13 -04:00
Jimmy Zelinskie
6188d52de0 models: Port method for PeerKey
This also adds some more docs for related stuff in the models package.
2015-03-22 19:41:57 -04:00
Jimmy Zelinskie
92866cfacd models: include port in peerkey 2015-03-22 18:44:09 -04:00
Justin Li
7512f50731 udp: Add basic UDP tests 2015-02-21 14:35:21 -05:00
Justin Li
afb22c3df6 udp: Add basic logging and more comments 2015-02-20 14:08:46 -05:00
Justin Li
e3aff35532 models: Use a uint16 for port numbers 2015-02-20 02:06:44 -05:00
Justin Li
87c68f1973 2015 2015-01-01 12:02:25 -05:00
Jimmy Zelinskie
d754b5b376 Return PeerMap by reference.
In accordance with `go vet`, locks should only be returned by reference.
2014-10-28 12:28:51 -04:00
Paul Saab
be2ddb7e4d Fix IPv4 stats
net.ParseIP() will return a v4mapped address which makes len(ip) ==
IPv6len and breaks stats for IPv4 requests.
2014-09-29 11:55:18 -07:00
Jimmy Zelinskie
b910fdabf5 Organize peers by subnet.
This commit restructures PeerMaps to be a map from Subnet to
PeerID to Peer. This reduces the complexity require to gather peers from
the same subnet.
2014-09-23 23:00:50 -04:00
Jimmy Zelinskie
9e45f77efe Create peermap.go, add documentation 2014-08-04 06:37:31 -04:00
Jimmy Zelinskie
3cb286fb40 Introduce thread-safe PeerMap 2014-08-04 06:15:08 -04:00
Justin Li
d610b4ebb0 Address easy golint comments 2014-08-01 16:16:38 -04:00
Justin Li
ac61c7880d Record raw upload/download 2014-08-01 16:07:10 -04:00
Jimmy Zelinskie
f747a79c8c Calculate up/down delta before altering peer 2014-08-01 15:11:37 -04:00
Justin Li
6f514cbad5 Fix snatched logic to read seeder list before updating it
Refactor more
2014-08-01 13:35:35 -04:00
Justin Li
14fd5612af Remove user snatches (should be handled by backend) 2014-08-01 13:25:30 -04:00
Justin Li
24b4437edd Initial refactor to store more in the Announce 2014-08-01 13:24:24 -04:00
Justin Li
bfd8e110ea Add a comment explaining why Peer.IP is unambiguous 2014-08-01 12:50:24 -04:00
Justin Li
b628b934ac Only keep one IP in the Peer type 2014-08-01 12:37:35 -04:00
Jimmy Zelinskie
e52e4d5f1d Introduce PeerKey
PeerKeys are used to prevent overwriting of peers which want to announce
for both IPv4 and IPv6.
2014-08-01 11:21:57 -04:00
Jimmy Zelinskie
ffb3c57181 move whitelist into cfg 2014-07-25 16:58:26 -04:00
Justin Li
818bef28d7 More refactoring of error handling 2014-07-25 03:05:43 -04:00
Jimmy Zelinskie
788b349dd7 ClientError base type struct -> string 2014-07-24 19:34:17 -04:00
Justin Li
02f67b4259 Create a ClientError type to distinguish between failure modes 2014-07-24 17:57:44 -04:00
Justin Li
b227fc1fcd Support dual-stacked peers 2014-07-23 13:15:04 -04:00
Justin Li
6396990e52 Move errors to tracker/models 2014-07-23 00:37:30 -04:00
Justin Li
ba1ad7f5bf Prevent non-active peers from announcing events 2014-07-23 00:30:11 -04:00
Justin Li
e17c984ec8 Fix semantics of seed stats, fix Peer.IPv6() always returning true 2014-07-22 01:06:30 -04:00
Jimmy Zelinskie
2c8894fbda rollout more stats 2014-07-21 20:24:51 -04:00
Justin Li
af57763882 Commit some staged changes 2014-07-21 10:53:26 -04:00
Jimmy Zelinskie
78d94d1e99 Change PeerMap key to PeerID 2014-07-19 04:21:28 -04:00
Jimmy Zelinskie
5bd3b3efb3 update docs all around 2014-07-18 19:09:06 -04:00
Justin Li
67a8473f6e Clean up types more 2014-07-17 01:14:50 -04:00
Justin Li
9dde295b7c Move AnnounceResponse and ScrapeResponse to models 2014-07-17 01:10:50 -04:00
Justin Li
343b3358a1 Move NewAnnounce and NewScrape to http, since they are an implementation detail 2014-07-17 00:54:53 -04:00
Justin Li
da19ed3e21 Separate tracker logic from the http package, step 1 2014-07-17 00:09:56 -04:00
Renamed from models/models.go (Browse further)