Commit Graph

25 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
806ce1d18b Address @DiegoRBaquero's feedback
From comment:
https://github.com/feross/bittorrent-tracker/pull/198#discussion_r993882
95
2017-02-08 13:13:20 -08:00
Feross Aboukhadijeh
d534582a8c Only close websocket when it's not participating in any more swarms 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
29d4564bbd remove unneeded timeout 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
1b22b53fe8 fix tests: wait for socket to send final responses 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
7075088848 Close websockets when peers are evicted from LRU cache
Possibly fixes: https://github.com/feross/bittorrent-tracker/issues/196

Close websockets when peers are evicted from LRU cache, otherwise it's
possible for a peer object to be evicted from the LRU cache without the
socket being cleaned up. That will leak memory until the websocket is
closed by the remote client. It also messes up the stats.
2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
8f33b95f9f swarm maxAge: increase to 20 min 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
62dd0f7df2 treat unexpected 'completed' events as 'updated' 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
ed3da2f39b If peer is already complete, it should still be refreshed in the LRU cache 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
9cf2dffa67 debug: better debug names 2017-01-20 18:34:33 -08:00
Alex
f14d0b83df Add id parameter in announce calls 2016-08-08 17:25:25 +02:00
Yoann Ciabaud
2c7ea4e307 Refactor id usage in announce and fix default peersCacheTtl 2016-06-14 07:15:57 +02:00
Yoann Ciabaud
d51a77b028 Update lru package to 3.0.0 and set peersCacheLength to 1K as default 2016-06-10 10:00:19 +02:00
Yoann Ciabaud
5843b7d2f6 Bugfix in manual peer eviction. 2016-06-10 00:29:56 +02:00
Yoann Ciabaud
7f98203d5e Manually clean peers on announce 2016-06-09 16:28:31 +02:00
Yoann Ciabaud
5dcc932247 Refresh cache on changes and handle access to evicted peer 2016-06-09 02:10:07 +02:00
Yoann Ciabaud
ca522c0c4b Prune old peers in server with lru based cache. Issue #4 2016-06-08 23:57:01 +02:00
Yoann Ciabaud
eb3cefec35 Use type from server to filter peers to offer 2016-03-13 15:51:08 +01:00
Feross Aboukhadijeh
e3c65bc2a3 PR Feedback for #120 2016-03-11 17:21:19 -08:00
Yoann Ciabaud
af631d9fce Merge remote-tracking branch 'upstream/master' into client-infos 2016-03-11 10:34:07 +01:00
Yoann Ciabaud
2f37e6c476 Adds a type param to identify the source of the peer 2016-03-11 10:09:09 +01:00
Feross Aboukhadijeh
0585d8b18a use delete obj[key] instead of obj[key] = null 2016-03-10 21:26:28 -08:00
Diego Rodríguez Baquero
e185f321d3 Delete peer on announce stopped 2016-03-11 01:10:34 -03:00
Feross Aboukhadijeh
b5096e91c3 Support async createSwarm() and getSwarm()
Fix #95.

Make server.getSwarm() and server.createSwarm() into async functions
that take a callback.
2016-01-03 19:50:23 +01:00
Feross Aboukhadijeh
e6382c9af6 don't send peer to itself 2015-12-05 00:41:56 -08:00
Feross Aboukhadijeh
3746c05d79 restructure folders 2015-07-29 00:26:44 -07:00