From 88ae4c18593c61ed1c67d074cee373226c41ab32 Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 27 Jun 2015 14:40:44 +0200 Subject: [PATCH] Remove redundant 220 check --- lib/pure/asyncftpclient.nim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/pure/asyncftpclient.nim b/lib/pure/asyncftpclient.nim index c3545ada8c..979b0d6498 100644 --- a/lib/pure/asyncftpclient.nim +++ b/lib/pure/asyncftpclient.nim @@ -81,11 +81,10 @@ proc connect*(ftp: AsyncFtpClient) {.async.} = reply = await ftp.expectReply() # Handle 220 messages from the server - if reply.startsWith("220"): + assertReply(reply, "220") + while reply.continuesWith("-", 3): # handle multiline 220 message assertReply(reply, "220") - while reply.continuesWith("-", 3): # handle multiline 220 message - assertReply(reply, "220") - reply = await ftp.expectReply() + reply = await ftp.expectReply() if ftp.user != "": assertReply(await(ftp.send("USER " & ftp.user)), "230", "331")