Skip to content

cb firing multiple times #50

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

Open
lperrin opened this issue Dec 6, 2012 · 2 comments
Open

cb firing multiple times #50

lperrin opened this issue Dec 6, 2012 · 2 comments

Comments

@lperrin
Copy link
Collaborator

lperrin commented Dec 6, 2012

Near line 178, this code doesn't set cbFired to true:

onError = function(reason) {
        if (!cbFired && typeof cb === 'function') {
          cb(new Error(reason));
        }
      },
      onClose = function() {
        if (!cbFired && typeof cb === 'function') {
          cb();
        }
      },

If a TCP error occurs, the callback is called twice.

@felixge
Copy link
Owner

felixge commented Dec 6, 2012

@lperrin I just made you a contributor on github, feel free to push your suggested fix!

@lperrin
Copy link
Collaborator Author

lperrin commented Dec 7, 2012

I'll do that, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants