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

Correctly remove closed sockets from oident file, remove unused functions #753

Merged
merged 1 commit into from Dec 11, 2016

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Nov 20, 2016

No description provided.

@xPaw xPaw added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Nov 20, 2016
@xPaw xPaw added this to the 2.2.0 milestone Nov 20, 2016

function makeRule(connection) {
return "to " + connection.socket.remoteAddress
_.forEach(this.connections, (connection) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder as discussed on IRC:

Use Map for the connections object and iterate with native forEach (then remove const _ = require("lodash"); above).

@ronilaukkarinen
Copy link
Contributor

Checked this, just reporting it doesn't fix a bug with ident being the same. Fixes undefineds in .oidentd.conf though.

Copy link
Member

@maxpoulin64 maxpoulin64 left a 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
Copy link
Member

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?

Copy link
Member Author

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) {
Copy link
Member

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 :)

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@astorije astorije left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@astorije astorije merged commit 9c8b2cb into master Dec 11, 2016
@astorije astorije deleted the xpaw/oident branch December 11, 2016 08:36
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Correctly remove closed sockets from oident file, remove unused functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants