Commit Graph

55 Commits

Author SHA1 Message Date
Jimmy Zelinskie
938542ac74 models: Announce field for AnnounceResponse 2015-04-04 15:42:28 -04:00
Jimmy Zelinskie
f25464a02b Merge branch 'master' into udp 2015-03-27 22:05:48 -04:00
Jimmy Zelinskie
1bf788a99b tracker: fix reference to config 2015-03-23 20:43:33 -04:00
Jimmy Zelinskie
80c068c97a config: add create_on_announce option
This option allows the user to specify whether or not to create a new
swarm for torrents that do not previously exist within the tracker's
storage.
2015-03-23 20:02:13 -04:00
Justin Li
da46ef8c8a tracker: Return announcing peer if there are no others to avoid an empty peers field 2015-02-28 00:56:45 -05:00
Jimmy Zelinskie
ac2fcade1e tracker: record announce/scrape stats in handlers
This deduplicates code tracking the stats code tracking announces and
scrapes for each protocol. The down side is that it isn't aware of any
failures writing responses, but it was already being called before the
write to a response for HTTP.
2015-02-26 09:03:52 -05:00
Justin Li
b6c1b3838b tracker: Remove impossible code for 'completed' event 2015-02-21 13:00:23 -05:00
Justin Li
87c68f1973 2015 2015-01-01 12:02:25 -05: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
1d9b2bc322 First step towards removing Tracker Driver.
This feature isn't worth maintaining and if anyone needs to scale beyond
memory on a single box, we can evaluate it then.
2014-08-13 17:45:34 -04:00
Jimmy Zelinskie
fc18028796 Fix Purge reporting all peers as Seeders
PeerMaps now are constructed with a boolean value that tells the map
whether they are hosting seeders or leechers.
2014-08-05 06:57:48 -04:00
Jimmy Zelinskie
3cb286fb40 Introduce thread-safe PeerMap 2014-08-04 06:15:08 -04:00
Justin Li
a55219963b Prevent unsigned overflow from breaking stats 2014-08-01 16:11:34 -04:00
Justin Li
ac61c7880d Record raw upload/download 2014-08-01 16:07:10 -04:00
Jimmy Zelinskie
8051e0e22e Calculate delta based off of old peer 2014-08-01 15:51:26 -04:00
Jimmy Zelinskie
5622a3ded2 Only calculate delta if tracker is private 2014-08-01 15:19:27 -04:00
Jimmy Zelinskie
f747a79c8c Calculate up/down delta before altering peer 2014-08-01 15:11:37 -04:00
Justin Li
f48e1e452f Don't write to the peer maps in the announce code 2014-08-01 14:09:29 -04:00
Justin Li
2a12685007 Don't consider errored snatches to be snatches 2014-08-01 13:46:14 -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
b08195aeef Rename RequestsBlocked to ClientErrors and remove special cases from tracker code 2014-07-24 18:01:26 -04:00
Justin Li
98542c0ff1 Move tracker-specific logic out of http/query and into http 2014-07-23 15:56:15 -04:00
Justin Li
b227fc1fcd Support dual-stacked peers 2014-07-23 13:15:04 -04:00
Justin Li
84195deb58 Correctly handle ErrBadRequest in the announce handler 2014-07-23 01:26:47 -04:00
Justin Li
9054c1364a Don't error if the client is sending a started event 2014-07-23 01:20:25 -04:00
Justin Li
6396990e52 Move errors to tracker/models 2014-07-23 00:37:30 -04:00
Justin Li
6c7abdfa2d Don't return an HTTP error for "bad request" tracker errors 2014-07-23 00:33:00 -04:00
Justin Li
ba1ad7f5bf Prevent non-active peers from announcing events 2014-07-23 00:30:11 -04:00
Justin Li
ce2e335562 Remove IPv4/IPv6 stats specializations and replace with RecordPeerEvent 2014-07-22 23:41:20 -04:00
Justin Li
11d06f7830 Put leecherFinished in announce.go and remove unnecessary code 2014-07-22 23:31:19 -04:00
Justin Li
de69eaeafe Add current peer stats 2014-07-22 23:29:30 -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
26f87139e0 remove needless ipv6 checks 2014-07-21 21:04:28 -04:00
Justin Li
dc76657af3 Switch deleted torrent event 2014-07-21 20:49:17 -04:00
Jimmy Zelinskie
2c8894fbda rollout more stats 2014-07-21 20:24:51 -04:00
Jimmy Zelinskie
24f3e6b80b announce & scrape stats 2014-07-21 19:32:36 -04:00
Justin Li
7a849e6f20 Defer closing connections to prevent leaking them 2014-07-21 10:57:00 -04:00
Jimmy Zelinskie
6b260b7352 close tracker pool connections & some style changes 2014-07-21 03:58:07 -04:00
Jimmy Zelinskie
490dfa7877 implement incrementing user's snatches 2014-07-19 04:22:27 -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
6b089342d1 Simplify subnet preference code considerably 2014-07-17 14:15:05 -04:00
Jimmy Zelinskie
809735c504 rm extra if; add missing expr for ipv6 subnet 2014-07-17 08:27:08 -04:00
Jimmy Zelinskie
f54f688ab2 correct comment [ci-skip] 2014-07-17 04:21:12 -04:00