]> source.dussan.org Git - rspamd.git/commitdiff
* Fix states in smtp dialog
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 24 Jun 2010 15:10:13 +0000 (19:10 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 24 Jun 2010 15:10:13 +0000 (19:10 +0400)
src/smtp.c
src/smtp.h

index f2c085aba52b9a15e7f3d5a866400c4611d6be2b..74d156bdd144597f66ff186bd32ee700616ff420 100644 (file)
@@ -196,7 +196,7 @@ read_smtp_command (struct smtp_session *session, f_str_t *line)
                        }
                        break;
                case SMTP_COMMAND_QUIT:
-                       session->state = SMTP_STATE_END;
+                       session->state = SMTP_STATE_QUIT;
                        break;
                case SMTP_COMMAND_NOOP:
                        break;
@@ -445,7 +445,9 @@ smtp_read_socket (f_str_t * in, void *arg)
                                        destroy_session (session->s);
                                        return FALSE;
                                }
-                               smtp_write_socket (session);
+                               if (! smtp_write_socket (session)) {
+                                       return FALSE;
+                               }
                        }
                        break;
                case SMTP_STATE_AFTER_DATA:
@@ -476,7 +478,7 @@ smtp_read_socket (f_str_t * in, void *arg)
                        break;
        }
 
-       if (session->state == SMTP_STATE_END) {
+       if (session->state == SMTP_STATE_QUIT) {
                destroy_session (session->s);
                return FALSE;
        }
index 11062543d83872254f39239fae50863493339208..f8aaaeb8458c89f4f46772e85e05e6b38ffffb3b 100644 (file)
@@ -48,6 +48,7 @@ enum rspamd_smtp_state {
        SMTP_STATE_DATA,
        SMTP_STATE_AFTER_DATA,
        SMTP_STATE_END,
+       SMTP_STATE_QUIT,
        SMTP_STATE_WAIT_UPSTREAM,
        SMTP_STATE_IN_SENDFILE,
        SMTP_STATE_ERROR,