diff options
-rw-r--r-- | lib/pure/asyncftpclient.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pure/asyncftpclient.nim b/lib/pure/asyncftpclient.nim index daf69d59f..c3545ada8 100644 --- a/lib/pure/asyncftpclient.nim +++ b/lib/pure/asyncftpclient.nim @@ -79,7 +79,13 @@ proc connect*(ftp: AsyncFtpClient) {.async.} = # 120 Service ready in nnn minutes. # We wait until we receive 220. reply = await ftp.expectReply() - assertReply(reply, "220") + + # Handle 220 messages from the server + if reply.startsWith("220"): + assertReply(reply, "220") + while reply.continuesWith("-", 3): # handle multiline 220 message + assertReply(reply, "220") + reply = await ftp.expectReply() if ftp.user != "": assertReply(await(ftp.send("USER " & ftp.user)), "230", "331") |