Conversation
|
So I've been checking out the FTP RFC and I'm not sure this change makes sense. Which seems to imply that only the first line uses the '-' character to indicate multiline. Since that is already consumed before this function is called, I don't think it needs to be checked. Can you show the output that you received? Maybe I'm not interpreting this correctly or they are doing something nonstandard. |
|
Yeah...not the right fix for the general case. It would solve the data I was getting from bom.gov.au. The message was something like: So what we should look for is |
|
Check out https://stackoverflow.com/questions/15820936/how-do-ftp-replies-work, especially the comment below the question. It is common for FTP servers to format multiline messages this way, even if that's not in accordance with the original RFC. I stumbled over this when I got a FileZilla response that was formatted this way. I was actually in the process of doing a PR for this when I found this one :) @brushbox You should probably implement it the way you mentioned (stop when code repeats and the next character is a space). I added a test for that as well in my fork. |
|
I've tried to make this work in the general case here: #21 Still have to write some tests, but I'd like someone to confirm this works. I don't have access to a server that behaves this way, so if someone could test it themselves, or provide me a way to do it myself then I can consider merging my solution and closing this. |
I'm a bit of a Haskell n00b - this is my first PR.
I was trying to use ftp-client to look at
ftp.bom.gov.aubut it was failing on the welcome message. It seemed to not read the entire message. This small change fixed that problem. I'm not sure if it is a broadly valid solution (I suspect it might fail on a line that contains only the status code and no other chars). Not sure how to test that.I would write some tests...but I haven't gotten that far with Haskell yet.