-
Notifications
You must be signed in to change notification settings - Fork 700
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
Correctly remove closed sockets from oident file, remove unused functions #753
Conversation
|
||
function makeRule(connection) { | ||
return "to " + connection.socket.remoteAddress | ||
_.forEach(this.connections, (connection) => { |
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.
Checked this, just reporting it doesn't fix a bug with ident being the same. Fixes undefineds in .oidentd.conf though. |
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.
Looks good to me, cleans up that quite old code.
@@ -6,6 +6,7 @@ env: | |||
browser: true | |||
mocha: true | |||
node: true | |||
es6: true | |||
|
|||
parserOptions: | |||
ecmaVersion: 6 |
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.
es6: true
makes ecmaVersion: 6
unnecessary (see eslint/eslint#7067). Do you mind removing parserOptions
?
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.
Done.
hookSocket: function(socket, user) { | ||
var that = this; | ||
var id = null; | ||
addSocket: function OidentdFileAddSocket(socket, user) { |
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.
If you make OidentdFile
a class, I believe you could write these something like:
class OidentdFile {
/* ... */
addSocket(socket, user) {
/* ... */
}
/* ... */
}
I definitely don't like naming a method differently than its descriptor (addSocket
vs. OidentdFileAddSocket
) and I even dislike more naming non-class-like functions with an uppercase, so I think that would be a win-win :)
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 definitely should start using classes, yeah. But for this PR I'll just remove the name additions.
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.
I think it would have been fine to convert them as we change them, so this PR was as a good time as any, but I'm fine either way.
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.
Good job!
Correctly remove closed sockets from oident file, remove unused functions
No description provided.