From 6aba6239e8ab54b8db7ad0b76b1a8870af682d32 Mon Sep 17 00:00:00 2001 From: Johan Sommerfeld Date: Thu, 6 Oct 2016 16:57:45 +0200 Subject: Fix inets ftp bug related to multiple lines resp Fixes a bug that makes the ftp client end up in bad state if there is a multi line response from the server and the response number is in the message being sent. --- lib/inets/test/ftp_format_SUITE.erl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/inets/test/ftp_format_SUITE.erl') diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index a33b31f46f..95d594a44b 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -38,8 +38,8 @@ all() -> groups() -> [{ftp_response, [], [ftp_150, ftp_200, ftp_220, ftp_226, ftp_257, ftp_331, - ftp_425, ftp_other_status_codes, ftp_multiple_lines, - ftp_multipel_ctrl_messages]}]. + ftp_425, ftp_other_status_codes, ftp_multiple_lines_status_in_msg, + ftp_multiple_lines, ftp_multipel_ctrl_messages]}]. init_per_suite(Config) -> Config. @@ -141,6 +141,15 @@ ftp_425(Config) when is_list(Config) -> {trans_neg_compl, _} = ftp_response:interpret(Msg), ok. +ftp_multiple_lines_status_in_msg() -> + [{doc, "check that multiple lines gets parsed correct, even if we have " + " the status code within the msg being sent"}]. +ftp_multiple_lines_status_in_msg(Config) when is_list(Config) -> + ML = "230-User usr-230 is logged in\r\n" ++ + "230 OK. Current directory is /\r\n", + {ok, ML, <<>>} = ftp_response:parse_lines(list_to_binary(ML), [], start), + ok. + ftp_multiple_lines() -> [{doc, "Especially check multiple lines devided in significant places"}]. ftp_multiple_lines(Config) when is_list(Config) -> -- cgit v1.2.3