summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLuca <acidvertigo@users.noreply.github.com>2015-06-27 14:40:44 +0200
committerLuca <acidvertigo@users.noreply.github.com>2015-06-27 14:40:44 +0200
commit88ae4c18593c61ed1c67d074cee373226c41ab32 (patch)
tree6701ee08ed5aec64ad2b643ef1b5fe7c864ba1ce
parent40a4a393740e3cf72dd37a243d5b72d7cde7f721 (diff)
downloadNim-88ae4c18593c61ed1c67d074cee373226c41ab32.tar.gz
Remove redundant 220 check
-rw-r--r--lib/pure/asyncftpclient.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/asyncftpclient.nim b/lib/pure/asyncftpclient.nim
index c3545ada8..979b0d649 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")