Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

One more fringe bugfix from buring this in at cl #180

Merged
merged 8 commits into from

2 participants

@godsflaw
Collaborator

This is one more bug fix that was tickled by a spammer.

@baudehlo baudehlo merged commit 2c044ca into baudehlo:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 12, 2012
  1. Check for dead state as well in error callbacks.

    Eric Day authored
  2. @godsflaw

    Merge pull request #4 from eday/master

    godsflaw authored
    Check for multiple error/close/timeouts when idle.
Commits on Apr 13, 2012
  1. Should only log errors while active.

    Eric Day authored
  2. @godsflaw

    Merge pull request #5 from eday/master

    godsflaw authored
    A better fix for that logging condition. It could have been happening while resetting.
  3. @godsflaw
  4. Added destroy for release state on error.

    Eric Day authored
  5. @godsflaw
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 6 deletions.
  1. +12 −6 smtp_client.js
View
18 smtp_client.js
@@ -107,16 +107,22 @@ function SMTPClient(port, host, timeout, enable_tls) {
var closed = function (msg) {
return function (error) {
- if (self.state == STATE_IDLE) {
- self.state = STATE_DEAD;
+ if (!error) {
+ error = '';
}
- else if (self.state != STATE_DESTROYED) {
- if (!error) {
- error = '';
- }
+ if (self.state == STATE_ACTIVE) {
self.emit('error', self.uuid + ': SMTP connection ' + msg + ' ' + error);
self.destroy();
}
+ else {
+ logger.logdebug('[smtp_client_pool] ' + self.uuid + ': SMTP connection ' + msg + ' ' + error + ' (state=' + self.state + ')');
+ if (self.state == STATE_IDLE) {
+ self.state = STATE_DEAD;
+ }
+ else if (self.state == STATE_RELEASED) {
+ self.destroy();
+ }
+ }
};
};
Something went wrong with that request. Please try again.