diff --git a/ftp-client/src/Network/FTP/Client.hs b/ftp-client/src/Network/FTP/Client.hs index 33e33dd..afabdc3 100644 --- a/ftp-client/src/Network/FTP/Client.hs +++ b/ftp-client/src/Network/FTP/Client.hs @@ -40,6 +40,10 @@ module Network.FTP.Client ( Handle(..), -- * Exceptions FTPException(..), + -- * System Handle Creation + createSIOHandle, + createTLSConnection, + connectTLS, -- * Handle Implementations sIOHandleImpl, tlsHandleImpl, @@ -269,8 +273,8 @@ loopMultiLine loopMultiLine h code lines = do nextLine <- liftIO $ getLineResp h let newLines = lines <> [C.dropWhile (== ' ') nextLine] - nextCode = C.take 3 nextLine - if nextCode == code + isLastLine = C.isPrefixOf (code <> " ") nextLine -- Ref for reading multiline response : https://datatracker.ietf.org/doc/html/rfc959#page-36 + if isLastLine then return newLines else loopMultiLine h code newLines