148 Commits
Author SHA1 Message Date
Daniel García da79249763 Update tokio-rustls to 0.23 and release 6.0.0, this is an API break if using the secure feature 2021-11-04 22:52:27 +01:00
Daniel García 0aabb0c7d2 Update to 5.1.0 2021-11-04 22:45:00 +01:00
Daniel García 25258474fd Small additions based on PRs to the original fork
- Added function to get server welcome message.
- Use the peer address when the server responds
  with all zeroes like is the case with IPv6.
- Added some small tests for types
- Make the test results clearer, using ? instead of asserting is_ok()
2021-11-04 22:22:05 +01:00
Daniel García 17e31bffbe Merge pull request #11 from mihaigalos/add_resume
Add resume functionality
2021-11-04 21:57:30 +01:00
Mihai GalosandDaniel García a76ae5fffe Update src/ftp.rs
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2021-11-04 20:48:24 +01:00
Mihai GalosandDaniel García ece0aa2744 Update src/ftp.rs
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2021-11-04 20:48:17 +01:00
Mihai GalosandDaniel García 12b04c40a2 Update src/ftp.rs
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2021-11-04 20:48:13 +01:00
Mihai Galos 280885543b Add resume functionality 2021-11-04 18:00:16 +01:00
Daniel García c938d71848 Merge pull request #4 from dani-garcia/tokio03
Update to Tokio 0.3
2020-12-30 19:06:04 +01:00
Daniel García 5ecdb659c1 Update to tokio 1.0, simplify testing and update version 2020-12-30 19:04:40 +01:00
Daniel García bac93e3df3 Update to Tokio 0.3 2020-12-30 19:04:40 +01:00
Daniel García 0d87d2d702 Merge pull request #9 from dodomorandi/retr-generic-error
Make FtpStream::retr error return type generic
2020-11-14 14:10:23 +01:00
Edoardo Morandi 8d3e04d8fb Make retr error return type generic 2020-11-10 11:54:09 +01:00
Daniel García 19a7a18ec9 Update to 4.0.4 2020-11-07 01:18:29 +01:00
Daniel García 648bfe371e Merge pull request #8 from SamedhG/dumb-mistake
Made a dumb error here's the fix
2020-11-07 01:17:49 +01:00
SamedhG aadccda1b6 Made a dumb error here's the fix 2020-11-06 17:27:10 -05:00
Daniel García e8786e5258 Update to 4.0.3 2020-11-06 22:44:05 +01:00
Daniel García 04100a7012 Merge pull request #7 from SamedhG/get-fix
Fix the minor bug in FtpStream::Get
2020-11-06 22:31:59 +01:00
SamedhG 1ba09ac685 Fix the minor bug in FtpStream::Get 2020-11-06 15:08:00 -05:00
Daniel García 92fb11bff6 Merge pull request #2 from dodomorandi/multiplatform_lines
Split lines according to both dos and unix conventions
2020-10-22 19:35:22 +02:00
Edoardo Morandi fc90c3dca9 Make get_lines_from_stream work for unix newlines 2020-10-19 18:12:17 +02:00
Edoardo Morandi 46d98f0448 Add test for list returning unix newlines
* Split implementation of `list_command` into the new
  `get_lines_from_stream` fn in order to make it easier to test
* Add two tests `get_lines_from_stream` for dos and unix newlines
2020-10-19 17:46:24 +02:00
Daniel García b7b14d4cae Merge pull request #1 from dodomorandi/master
Drop data stream before waiting close code
2020-10-14 22:25:02 +02:00
Edoardo Morandi d43be45384 Drop data stream before waiting close code 2020-10-13 17:47:52 +02:00
Daniel García 8c94c28ad7 Updated readme 2020-06-03 22:43:04 +02:00
Daniel García 02ff642c05 Async support with tokio 2020-06-03 22:37:36 +02:00
Daniel García ff2242a211 Update code to 2018 edition, upgraded all dependencies, replaced try! with ?, and removed deprecated Error methods 2020-06-03 17:59:32 +02:00
Matt McCoy f0e4717ba7 Add 200 as proper CDUP response code fixes #73 (#79)
* Add 200 as a proper CDUP response code

* Bump version from 3.0.0 -> 3.0.1
2018-04-15 13:51:28 -04:00
Matt McCoy 71702cca2c Bumping version from 2.1.2 -> 3.0.0 2018-02-28 14:36:21 -05:00
rrevenantt 9f686b5e60 Accept also a 250 response code for RETR, STOR and LIST commands (#76) 2018-02-28 14:32:26 -05:00
Luxed c39289987f Update to version 0.9 of OpenSsl (#69)
* Issue with list found: No code is sent at the beginning and the and at the end of the list function
List now works.
Everthing after a list doesn't work (PASV mode removes codes ?)

* Cannot move out of borrowed content..........

* rolled bad main branch

* into secure now taking a SslContext

* Updated help and test

* Switched back to anonymous in help of secure ftp

* Updated help: context is not a reference

* Added openssl as an external crate in the tests

* Got it back to the original, pre-update state

* removed general imports for specific ones

* No more issues (hopefully)
2018-02-08 18:04:48 -05:00
Matt McCoy 0baeaa5822 Update README badges (#66)
Add badges for number of crate downloads, crate license,
and coverage status.
2017-10-16 20:09:51 -04:00
Matt McCoy 6de46bfae0 Document secure flag in README (#65) 2017-10-16 19:55:28 -04:00
Matt McCoy 8357096d0d Use doc.rs URL for documentation link in README 2017-10-16 19:46:44 -04:00
Matt McCoy d32f2d9758 Update Cargo.toml with repo metadata
This changes the documentation URL to go to docs.rs
instead of my github pages. It also adds categories,
and badges in crates.io.
2017-09-29 22:52:40 -04:00
Matthieu Wipliez 3de12e12a7 Make code more ergonomic (#59)
* remove unnecessary allocations (calls to format! and String::from)
  * make write_str accepts S: AsRef<str> so we can pass a String without having to borrow it manually
  * make list_command accept Cow<'static, str> (better than AsRef because we can have both a &str or a String at calling site)
  * retr is generic over its result type (backward-compatible change)
  * rewrite retr in a more ergonomic way
  * rewrite simple_retr to use retr, remove simple_retr_

Possible backward-incompatible improvements, requiring major version changes:

  - make simple_retr return a Vec rather than a Cursor
  - change the signature of retr from Fn(&mut Read) to FnMut(R) where R: Read?
2017-03-02 18:35:28 -05:00
Matthieu Wipliez 20422f0f9b Add more tests (#60)
* add docker with configuration of vsftpd to test more easily

* update README

* porting script from docker to travis

* must run vsftpd inside the docker

* improved Dockerfile and README

* added & fixed tests

* trying to make .travis.yml prettier
2017-01-23 22:03:40 -05:00
Matt McCoy 215160bbf5 Updating minor version because we allow modifying the read/write timeout of TcpStream 2017-01-17 22:47:10 -05:00
Matthieu Wipliez fbf636d001 added get_ref() method to allow setting read/write timeout, see #52 (#58) 2017-01-17 22:42:10 -05:00
Matt McCoy 606b883622 Bumping the patch version because a bug has been fixed with list_command 2017-01-16 21:53:25 -05:00
Coco afcf2dfbad Drop data connection early in FtpStream.list_command() (#55)
Fixes issue #54.

The problem is that we're expecting to read a response from the server
on the control connection, but the server will only send a response when
the data connection has been properly closed. We can ensure this by
dropping the data connection before reading the server response.
2017-01-16 21:47:43 -05:00
Matt McCoy b3c10e937f #53 Updating the ftps docs to a working example (#57) 2017-01-16 21:24:48 -05:00
Matt McCoy 17ad10c715 Bumping major version after breaking changes 2016-08-22 20:46:39 -04:00
Zack Mullaly 2ea22f409c Persist custom ssl (#49)
* Update the example to be consistent with the API

* Simplified the README example, relying on the convention that using unwrap in examples is acceptable

* Fixed the rest of the API references

* Fixed syntax error

* Tested program in a working environment and fixed last syntax errors

* Fixed indentation

* Fixed indentation

* Add a secure_with_ssl method to FtpStream so that users can supply their own SSL configuration

* Add a field to FtpStream when compiling with the secure feature that will contain ssl configuration information to be used in data_command

* Fixed compilation errors

* Make the openssl requirement mandatory. It's not worth it to fragment the codebase and have multiple copies of definitions of things to work around a feature flag when the tradeoff is having a lot more usable SSL

* Since the secure() and insecure() methods actually have type signatures very similar to the into() method (https://doc.rust-lang.org/std/convert/trait.Into.html#tymethod.into), I changed their names to into_secure and into_insecure to be a little clearer about how they work

* Create a new FtpsStream<T> type and revert back to the old FtpStream type for other cases. The new type allows us to retain (and require) information about an Ssl configuration only when the user wants to supply one. Need a way to avoid so much code duplication though

* Let use of OpenSsl and indeed the entire FtpsStream type be optional under the secure feature flag again

* Move back to a single-type model with an SSL field that is only present when the secure feature flag is used
2016-08-22 20:35:45 -04:00
Matt McCoy 8538e5f519 Updating version to 1.0.0 2016-08-01 11:58:35 -04:00
Zack Mullaly 3d93a7079e Unify the library's interface and tidy up some code (#47)
Unify the library's interface and tidy up some code
2016-08-01 11:31:59 -04:00
Anton Yackushev 2e51b31e5a add DELE command for delete file. (#46) 2016-07-23 00:09:10 -04:00
Zack Mullaly e7b883d70a Add a secure_with_ssl method to FtpStream so that users can supply their own SSL configuration (#44) 2016-07-22 16:22:58 -04:00
Zack Mullaly 3423aaf2c7 Update readme (#45)
Updating README to be consistent with the API and simple
2016-07-22 16:15:04 -04:00
Matt McCoy a6ad79fead Adding creates.io badge 2016-06-15 21:55:00 -04:00