Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues in transfering file in binary mode #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abaw
Copy link

@abaw abaw commented Jun 23, 2014

Hi John,
I was to implement some FTP server thing and found ftphs. But I found transferring files in binary mode didn't work in my environment(CentOS 6.4). This is because vGetContents/hGetContents does not work with binary files if the byte sequence could not be decoded into Char. So I tried to fix it and here is the result, please take a look. Thanks.

P.S. I tried to follow the coding style carefully, but I am a Haskell newbie, there might be some non-idiomatic code.

Regards,

Ken

abaw added 3 commits June 20, 2014 23:53
The original implementation is based on vGetContents which does not work
if the binary file contain byte sequence that could not be decoded into
[Char]. The new implementation is based on vGetBuf which works for
binary data.
I implemented genericTransmitString based on genericTransmitHandle,
hence could remove the usage of rtransmitString.
cmd_stor has similar issue with cmd_retr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant