summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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")