Преглед изворни кода

Fix wait for QUIT in wrong state

Thomas Dy пре 2 година
родитељ
комит
1d5e47d8ec
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      smtp.ts

+ 3 - 3
smtp.ts

@@ -79,9 +79,6 @@ export class Session {
     if (command === "HELO" || command === "EHLO") {
       this.state = State.WaitingMail;
       this.output("250 OK");
-    } else if (command === "QUIT") {
-      this.output("221 smtp2rss closing");
-      this.conn.close();
     } else {
       this.output("500 Invalid state");
     }
@@ -98,6 +95,9 @@ export class Session {
       } else {
         this.output("500 Invalid sender");
       }
+    } else if (command === "QUIT") {
+      this.output("221 smtp2rss closing");
+      this.conn.close();
     } else {
       this.output("500 Invalid state");
     }