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

fix: The socket cann't be release when disconnect after DATA command … #2994

Merged
merged 3 commits into from
Nov 15, 2021

Conversation

catroll
Copy link
Contributor

@catroll catroll commented Oct 26, 2021

Fixes #2992

--- a/connection.js
+++ b/connection.js
@@ -186,6 +186,12 @@ class Connection {
         });

         self.client.on('timeout', () => {
+            // FIN has sent, when timeout just distroy socket
+            if (self.state >= states.DISCONNECTED) {
+                self.client.destroy();
+                self.loginfo(`timeout, distroy socket (state:${self.state})`)
+                return;
+            }
             if (self.state >= states.DISCONNECTING) return;
             self.respond(421, 'timeout', () => {
                 self.fail(`${rhost} connection timed out`);

connection.js Outdated Show resolved Hide resolved
connection.js Outdated Show resolved Hide resolved
Copy link
Member

@msimerson msimerson left a comment

Choose a reason for hiding this comment

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

LGTM

@msimerson msimerson merged commit 10706ae into haraka:master Nov 15, 2021
@msimerson msimerson mentioned this pull request Jun 4, 2022
13 tasks
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

Successfully merging this pull request may close these issues.

The socket cann't be release when disconnect after DATA command
2 participants