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

FIX - Re-add openssl #97

Merged
merged 5 commits into from
Jan 13, 2021

Conversation

Elrendio
Copy link
Contributor

@Elrendio Elrendio commented Dec 19, 2020

What it does

@ChristianVisintin you might be interested 🙂
@mattnenterprise I guess you have a notification as maintainer but in case ^^

Notes on changes

Dependencies

I've removed the minor and patch versions in dependencies as that's equivalent to the carret condition which is what cargo uses by default (see cargo documentation). I believe it's best not to specify minor versions if not used with = (aka my_lib = "=1.2.3") as less experienced developers might not know that cargo can choose an newer version then what's written.

Imports

I've grouped dependencies (which I think should be the good practice) because it reduces the number of lines used for imports and allows a more visual representation of what it used in a library.

Welcome message

I was not convinced with the current implementation of the welcome message for two reason:

  • It increases the memory size of the struct FtpStream for data you probably need to read only once
  • The field welcome_msg is an option in the the struct FtpSteam suggesting it might not be here, however implementation made it available in all cases only to simplify the implementation of the function connect

Therefore I've made it available in the return of the function connect 🙂

Result vs crate::Result

I find it quite misleading to override import from rust prelude and notably for the result enum. If therefore moved the type Result<T> to lib.rs and use crate::Result to indicate the functions return a classical result of the crate rather than juste a classical result

About the put command

When uploading files to an ftp server using openssl I had the error FTP 426 Failure reading network stream.. My guess was that the ssl stream wasn't closed properly and that the master connection couldn't read until the data stream was closed. This is probably the case only with session re-use as without master and data connection are completly independent. Anyway, the fix consists in forcing the connection to shutdown after uploading the file. I'm quite unhappy of how I'm doing that, ideally it should have been in something equivalent to a Drop implementation. I didn't do a custom Drop implementation because I didn't know how to handle the possible connectivity errors when doing the shutdown. This is something to keep in mind for #93. Anyway, currently it works 🎉

@Elrendio Elrendio force-pushed the FIX-RevertToOpenssl branch from 2446618 to adc0b72 Compare December 19, 2020 17:22
@Elrendio Elrendio force-pushed the FIX-RevertToOpenssl branch from 8fe2084 to d062a92 Compare December 19, 2020 18:03
@Elrendio
Copy link
Contributor Author

Elrendio commented Jan 7, 2021

@mattnenterprise When do you think you'll be able to merge this ? Thanks 🙂

@mattnenterprise mattnenterprise merged commit 3ad9eff into mattnenterprise:master Jan 13, 2021
@mattnenterprise mattnenterprise added this to the 4.0.0 milestone Jan 13, 2021
@Elrendio Elrendio deleted the FIX-RevertToOpenssl branch January 14, 2021 21:56
@Elrendio Elrendio restored the FIX-RevertToOpenssl branch January 15, 2021 14:17
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.

No way to implement ssl session reuse since #92
2 participants