Skip to content
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

Bugfixes for server.close() and server.destroy() #901

Merged
merged 2 commits into from Sep 13, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Handle no-arg server.destroy(), fixes #899

  • Loading branch information
dcposch committed Sep 4, 2016
commit 10ab81db0b929e8f2bf45e8c66935f473c13a50d
@@ -37,6 +37,7 @@ function Server (torrent, opts) {
})

// Only call `server.close` if user has not called it already
if (!cb) cb = function () {}

This comment has been minimized.

Copy link
@feross

feross Sep 13, 2016

Member

It's best to set all defaults at the top of the function instead of in the body.

if (closed) process.nextTick(cb)
else server.close(cb)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.