-
-
Notifications
You must be signed in to change notification settings - Fork 335
Fix stats and leaked websockets #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
27ae148
Fixes for PR #185
feross c2c8e36
Fix bug where left = 0 would be converted to Infinity
feross ed3da2f
If peer is already complete, it should still be refreshed in the LRU …
feross 62dd0f7
treat unexpected 'completed' events as 'updated'
feross 6351f2b
style: re-order methods
feross 8f33b95
swarm maxAge: increase to 20 min
feross 7075088
Close websockets when peers are evicted from LRU cache
feross 1b22b53
fix tests: wait for socket to send final responses
feross 29d4564
remove unneeded timeout
feross d534582
Only close websocket when it's not participating in any more swarms
feross e731106
test: ensure electron-webrtc is started only for test where it's needed
feross 4422067
test: server: check that all clients, server are destroyed
feross cd4a976
add failing tests for desired evicition behavior
feross 806ce1d
Address @DiegoRBaquero's feedback
feross 3f3db7d
client: socketPool should not be shared across clients
feross File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.slice(0) does nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to clone the array before looping over it, otherwise it behaves incorrectly because we're mutating it inside the loop here: https://github.com/feross/bittorrent-tracker/pull/198/files/ebe3c218feab4f5a6774d5092531c6b2e55fe608#diff-831f46884145ede920506b29d5681ab2R104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can read about this behavior of arrays here: https://stackoverflow.com/questions/21811630/splicing-a-javascript-array-from-within-the-callback-passed-to-foreach