diff options
author | jpadkins <jacobpadkins@gmail.com> | 2017-03-30 21:09:16 +0300 |
---|---|---|
committer | jpadkins <jacobpadkins@gmail.com> | 2017-03-30 21:09:51 +0300 |
commit | a7c5aea2f767a3cf78a5213230e60e705cc1886d (patch) | |
tree | b647cb60cc089eb6116676f35330c2d87d0fdea1 /check/magma/servers | |
parent | cd5198bd7c48ab4e2a7f7e60f1328a13d4977c72 (diff) |
Fixed client_close oversight in SMTP test.
Diffstat (limited to 'check/magma/servers')
-rw-r--r-- | check/magma/servers/smtp/smtp_check_network.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/check/magma/servers/smtp/smtp_check_network.c b/check/magma/servers/smtp/smtp_check_network.c index 3a14e2c7..18ad4d64 100644 --- a/check/magma/servers/smtp/smtp_check_network.c +++ b/check/magma/servers/smtp/smtp_check_network.c @@ -131,14 +131,14 @@ bool_t check_smtp_client_quit(client_t *client, stringer_t *errmsg) { // Test the QUIT command. if (client_print(client, "QUIT\r\n") != 6 || client_read_line(client) <= 0 || client_status(client) != 1 || st_cmp_cs_starts(&(client->line), NULLER("221"))) { + st_sprint(errmsg, "Failed to return successful status following the QUIT command."); - client_close(client); return false; } else if (client_read_line(client) > 0) { + st_sprint(errmsg, "The server failed to close the connection after issuing a QUIT command."); - client_close(client); return false; } @@ -208,23 +208,14 @@ bool_t check_smtp_network_basic_sthread(stringer_t *errmsg, uint32_t port, bool_ client_close(client); return false; } + // Submit QUIT and cleanup. + else if (!check_smtp_client_quit(client, errmsg)) { - // Test the QUIT command. - else if (client_print(client, "QUIT\r\n") != 6 || client_read_line(client) <= 0 || - client_status(client) != 1 || st_cmp_cs_starts(&(client->line), NULLER("221"))) { - st_sprint(errmsg, "Failed to return successful status following the QUIT command."); - client_close(client); - return false; - } - - else if (client_read_line(client) > 0) { - st_sprint(errmsg, "The server failed to close the connection after issuing a QUIT command."); client_close(client); return false; } client_close(client); - return true; } @@ -284,8 +275,11 @@ bool_t check_smtp_network_auth_sthread(stringer_t *errmsg, uint32_t port, bool_t } // Submit QUIT and cleanup. else if (!check_smtp_client_quit(client, errmsg)) { + + client_close(client); return false; } + client_close(client); return true; } |