Commit graph

143 commits

Author SHA1 Message Date
Jimmy Zelinskie
7cfa862f2c decouple HTTP tests from API usage 2015-10-11 19:23:30 -04:00
Jimmy Zelinskie
9add47ed07 pull API server out of http
Fixes #87.
2015-10-11 19:23:30 -04:00
Jimmy Zelinskie
c0c3eda290 config: make reaping configurable
This allows for configurable reaping rates and changes the default to
what many public trackers use in the wild.
2015-09-18 01:27:27 -04:00
Jimmy Zelinskie
c8e8b95bfe http: stop using remote http port
The remote port used to send the announce has nothing to do with the
port being listened to for the torrent client protocol.
2015-08-20 11:14:02 -04:00
Jimmy Zelinskie
0741df3575 logging: add error to udp logs
This also makes the format of UDP and HTTP logs a little more similar.
2015-06-26 21:07:29 -04:00
Justin Li
203e4e6020 Fix query parsing when blank values are present 2015-06-18 10:34:52 -04:00
Justin Li
242ba22f8c Add failing test that reproduces #63 2015-06-18 10:19:54 -04:00
Justin Li
de18172952 Update graceful import path 2015-04-28 20:32:19 -04:00
Justin Li
ae62188711 Disable graceful signal handling 2015-04-28 20:27:39 -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
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
7512f50731 udp: Add basic UDP tests 2015-02-21 14:35:21 -05:00
Justin Li
669128c83a tracker: Pass listen address into tracker.Server.Serve() 2015-02-21 13:16:21 -05:00
Justin Li
afb22c3df6 udp: Add basic logging and more comments 2015-02-20 14:08:46 -05:00
Justin Li
92f3c62456 tracker: Add common interface to start and stop servers 2015-02-20 13:39:19 -05:00
Justin Li
e3aff35532 models: Use a uint16 for port numbers 2015-02-20 02:06:44 -05:00
Justin Li
d9a7611eee http: Unexport announce/scrape creation functions 2015-02-20 01:36:49 -05:00
Justin Li
778b64defa udp: Add UDP configuration, move tracker shutdown to the main package 2015-02-19 23:46:28 -05:00
Jimmy Zelinskie
14ead047ab http: improve clarity of /check 2015-02-08 18:05:30 -05:00
Jimmy Zelinskie
dfbf4a6fad http: ping backend on healthcheck
Fixes #37.
2015-02-08 17:15:27 -05:00
Jimmy Zelinskie
443fb4b70d http: add GET route for clients 2015-02-08 02:20:48 -05:00
Jimmy Zelinskie
c4c678e7a9 http: add enough comments to pass go lint
[ci skip]
2015-02-03 02:54:34 -05:00
Justin Li
87c68f1973 2015 2015-01-01 12:02:25 -05:00
Jimmy Zelinskie
ddd10d9732 Begin refactor to better encapsulate configuration
This also updates the example_config.json which did not previously work.
Config.Config is now composed of embedded structs of other configs that
can later be used to clearly have a separation of concerns.
2014-11-01 20:12:40 -04:00
Jimmy Zelinskie
d46beb0f7d Remove unkeyed composite literals.
This was done to keep in accordance with `go vet`.
2014-10-28 12:26:37 -04:00
Justin Li
b778b3ea40 go fmt [ci skip] 2014-09-25 15:12:25 -04:00
Cooper Lees
17a6fefc3b Go routine stat 2014-09-25 11:47:50 -07:00
Paul Saab
3f5b6b55b0 Limit number of concurrent connections
Go's net/http library has no limits in place for number of concurrent
requests currently being processed.  This can result in an enormous
number of goroutines being created and the read/write buffer pools
growing unbounded resulting in OOM situations.
2014-09-25 10:58:07 -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
Justin Li
976a983aa7 go fmt [ci skip] 2014-09-03 10:18:26 -04:00
Cooper Lees
67df033c7f Add configurable HTTP read and write timeouts 2014-09-02 22:24:15 -07:00
Jimmy Zelinskie
417d2a3b12 Disable HTTP KeepAlives 2014-08-26 18:03:44 -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
e3420b4013 Silence net.OpErrors dealing with accept.
This code is borrowed from:
6e11439113/graceful.go (L52-L58)
2014-08-05 15:00:52 -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
d610b4ebb0 Address easy golint comments 2014-08-01 16:16:38 -04:00
Justin Li
b628b934ac Only keep one IP in the Peer type 2014-08-01 12:37:35 -04:00
Jimmy Zelinskie
ffb3c57181 move whitelist into cfg 2014-07-25 16:58:26 -04:00
Justin Li
cde8251bd3 Add logging for startup failure 2014-07-25 03:43:06 -04:00
Justin Li
3b84fb3f98 Better logging 2014-07-25 03:39:02 -04:00
Justin Li
818bef28d7 More refactoring of error handling 2014-07-25 03:05:43 -04:00
Justin Li
683e90631a Add pretty stats param and refactor error handling 2014-07-25 03:01:26 -04:00
Justin Li
ab43e6bd97 Add crazy struct flattening code 2014-07-24 20:28:07 -04:00
Jimmy Zelinskie
788b349dd7 ClientError base type struct -> string 2014-07-24 19:34:17 -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
02f67b4259 Create a ClientError type to distinguish between failure modes 2014-07-24 17:57:44 -04:00
Justin Li
1a79bdeb6b Add RequestsBlocked stat counter 2014-07-24 17:48:03 -04:00
Justin Li
2779560934 Fix typo 2014-07-24 17:10:43 -04:00