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
Justin Li
dfc31495b7
Fix splitting for IPv6 RemoteAddrs
2014-07-24 17:02:28 -04:00
Justin Li
7a64ae2d1b
Create dummy stats object for tests
2014-07-23 17:30:38 -04:00
Justin Li
d5da5daa88
Read RealIP header from the request header map
2014-07-23 15:59:07 -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
76c68a53b5
Add RealIPHeader configuration, and move network conf to its own struct
2014-07-23 14:00:17 -04:00
Justin Li
8369bbbcd8
Allow configuring if a peer may have 2 IPs
2014-07-23 13:36:31 -04:00
Justin Li
b227fc1fcd
Support dual-stacked peers
2014-07-23 13:15:04 -04:00
Justin Li
14843b9e89
Add AllowIPSpoofing configuration
2014-07-23 13:08:57 -04:00
Justin Li
4295ad739c
Reorder peer stats to provide a more readable output
2014-07-23 02:25:35 -04:00
Justin Li
bacf4f0fd4
Add really really verbose log level
2014-07-23 02:25:15 -04:00
Justin Li
f2cc5188dd
Amend announce test to include an instance of the started event
2014-07-23 01:39:20 -04:00
Justin Li
2a400a0419
Handle ErrBadRequest after HandleAnnounce is called
2014-07-23 01:34:40 -04:00
Justin Li
856568f1a8
Always log errors
2014-07-23 01:31:22 -04:00
Justin Li
84195deb58
Correctly handle ErrBadRequest in the announce handler
2014-07-23 01:26:47 -04:00
Jimmy Zelinskie
f8d12054c5
log request failures
2014-07-23 01:20:48 -04:00
Justin Li
e7481b31c1
Don't write ipv6 peers field if empty
2014-07-23 00:56:11 -04:00
Justin Li
b99e5e0c36
Add compact announce tests
2014-07-23 00:55:57 -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
8625c4b3c4
Update the easter egg
2014-07-23 00:12:29 -04:00
Justin Li
7fce8c9ad4
Add response time stats
2014-07-22 14:57:36 -04:00
Justin Li
8d8c1fba62
Don't write nil compact peer lists
2014-07-22 01:59:05 -04:00