From: Vsevolod Stakhov Date: Thu, 24 Jun 2010 15:10:13 +0000 (+0400) Subject: * Fix states in smtp dialog X-Git-Tag: 0.3.1~83 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4536c2547b508cfa575218f6ebc147bf471ba465;p=rspamd.git * Fix states in smtp dialog --- diff --git a/src/smtp.c b/src/smtp.c index f2c085aba..74d156bdd 100644 --- a/src/smtp.c +++ b/src/smtp.c @@ -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; } diff --git a/src/smtp.h b/src/smtp.h index 11062543d..f8aaaeb84 100644 --- a/src/smtp.h +++ b/src/smtp.h @@ -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,