Commit Graph

21 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
0aadcc1cbb Wait up to 1s for pending requests before destroy()
If the user calls:

client.stop()
client.destroy()

We should ensure that the final 'stopped' message reaches the tracker
server, even though the client will not get the response (because they
destroyed the client and no more events will be emitted).

If there are pending requests when destroy() is called, then a 1s timer
is set after which point all requests are forcibly cleaned up. If the
requests complete before the 1s timer fires, then cleanup happens right
away (so we're not stuck waiting for the 1s timer).

So, destroy() can happen one of three ways:

- immediately, if no pending requests exist
- after exactly 1s, if pending requests exist and they don't complete
within 1s
- less than 1s, if pending requests exist and they all complete before
the 1s timer fires
2017-01-20 18:41:28 -08:00
Feross Aboukhadijeh
c4f4f012dd Add fixes and tests for PR #179 2017-01-16 15:43:47 -08:00
Feross Aboukhadijeh
91cb2d3439 Merge pull request #179 from zunsthy/feature-add-user-agent
add 'user-agent' in HTTP header
2017-01-16 15:20:11 -08:00
Feross Aboukhadijeh
3a0fec0701 standard fixes 2016-11-22 19:52:01 -03:00
ZunSThy
bd8bc9f6af add 'user-agent' in HTTP header 2016-11-06 16:00:08 +08:00
ZunSThy
e0ede27049 Revert "add 'user-agent' in HTTP header"
This reverts commit 725527aa84.
2016-11-06 15:59:04 +08:00
ZunSThy
7ae7a2ca07 Revert "fix eslint"
This reverts commit 0444e937e2.
2016-11-06 15:58:52 +08:00
ZunSThy
0444e937e2 fix eslint 2016-10-29 04:25:50 +08:00
ZunSThy
725527aa84 add 'user-agent' in HTTP header 2016-10-29 02:51:37 +08:00
Feross Aboukhadijeh
c92b1714db Remove all Function.bind calls
For https://github.com/feross/webtorrent-desktop/issues/256
2016-03-28 23:38:23 -07:00
Feross Aboukhadijeh
6df64ffe06 Fixes for PR #126 2016-03-14 19:16:00 -07:00
Autarc
09e2b55e42 invoke callbacks of destroyed trackers 2016-03-14 17:13:34 +01:00
Feross Aboukhadijeh
b34fc100a1 fixes for PR #107 2016-02-29 12:34:06 -08:00
Feross Aboukhadijeh
1db2cb8736 Merge pull request #107 from yciabaud/announce-extension
Provide a way to give extra data on announce
2016-02-29 10:19:14 -08:00
Feross Aboukhadijeh
1e919c44cb changes for simple-get 2.0.0 2016-02-14 00:31:44 -08:00
Yoann Ciabaud
f1669a506e Provide a way to give updated announce opts via callback on setInterval 2016-02-03 08:28:38 +01:00
Feross Aboukhadijeh
e9322a32d6 code style 2015-12-02 15:31:20 -08:00
Aram Drevekenin
ab3482fc4f Changed infoHash to always be hex 2015-11-29 16:02:29 +02:00
Feross Aboukhadijeh
f5d2810c89 Announce to websocket tracker every 30 seconds (for #338) 2015-07-29 02:12:14 -07:00
Feross Aboukhadijeh
9db28c2fad massive cleanup 2015-07-29 01:47:09 -07:00
Feross Aboukhadijeh
3746c05d79 restructure folders 2015-07-29 00:26:44 -07:00