veeso / suppaftp

a super FTP/FTPS client library for Rust with support for both passive and active mode
Apache License 2.0
121 stars 31 forks source link

Remove EOL in command channel message logs #9

Closed devbydav closed 2 years ago

devbydav commented 2 years ago

Description

FTP commands and responses end with CRLF, which is logged, resulting in a double line return.

This removes the EOL from message to fix it.

FTP specifies CRLF as the only valid EOL marker. We know we use it, so I trimmed the end CRLF in sent commands. For response, I went for a safer approach in case some server don't use proper CRLF.

Let me know if you have a better idea than "CC OUT" / "CC IN" for control channel in/out ! ("CMD"/"RESP", "CC ->"/"CC <-" ...)

Type of change

Please select relevant options.

Checklist

Acceptance tests

wait for a project maintainer to fulfill this section...

devbydav commented 2 years ago

Could be nice to use enums for commands to send too, what do you think ?