Commit Graph

41 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
fe11c695cb do not close socket even when it's not in other swarms 2017-02-21 01:50:48 -08:00
Feross Aboukhadijeh
b2c2b8f0d0 do not access socket.infoHashes if socket is destroyed 2017-02-21 01:50:30 -08:00
Feross Aboukhadijeh
7d2318dce6 Use unordered-array-remove for better performance! 2017-02-13 17:30:22 -08:00
Feross Aboukhadijeh
a469740603 Merge pull request #198 from feross/fix-196
Fix stats and leaked websockets
2017-02-09 23:16:28 +01:00
Feross Aboukhadijeh
3d81e68124 standard 2017-02-08 16:22:13 -08:00
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
c2c8e36af7 Fix bug where left = 0 would be converted to Infinity
Possibly fixes: https://github.com/feross/bittorrent-tracker/issues/196
2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
27ae148167 Fixes for PR #185 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
9cf2dffa67 debug: better debug names 2017-01-20 18:34:33 -08:00
Sidd Sridharan
9d9893a0f2 parse params.left = 0 properly 2016-12-04 12:42:57 -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
Feross Aboukhadijeh
f60ecec0dc remove buffer-equals dependency 2016-03-24 03:25:31 -07:00
Feross Aboukhadijeh
35697f5187 Merge pull request #137 from fanatid/feature/buffer-equals
buffer-equals instead buffer-equal
2016-03-24 03:21:08 -07:00
Feross Aboukhadijeh
2fffdc6730 ws server: drop support for old tracker clients
old clients don’t send params.action === ‘action’
2016-03-23 21:27:32 -07:00
Kirill Fomichev
0193f58654 buffer-equals instead buffer-equal 2016-03-21 14:46:39 +03:00
Feross Aboukhadijeh
ba4a52d2d1 Fixes for PR #125 2016-03-15 20:06:39 -07:00
Yoann Ciabaud
39507bf8be Scrape implementation for websocket. Issue #116 2016-03-14 00:36:51 +01: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
Yoann Ciabaud
60f03b9529 Provide IP and HTTP headers in both HTTP and Websocket server 2016-03-03 11:10:54 +01:00
Alex
8692e45215 Fix display error 2016-01-13 15:57:22 -05: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