You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, just a feature request around scp. I used this project as I ran into difficulties cross-building with bindings to libssh2 (alexcrichton/ssh2-rs#22). The APIs are very similar so it wasn't a lot of effort to swap to using ssh-rs instead, but I did notice the scp API is higher-level in this library.
I definitely appreciate the higher-level API because it allowed me to throw out 60-odd lines of low-level data-streaming code I had had to write myself with ssh2-rs and instead just invoke scp.upload(src, dest), but in my case I'm uploading relatively large files which may take a few minutes to finish. To give a progress indicator to the user I used indicatif to render a nice progress bar, transfer speed, etc. by sending updates as I processed chunks. Because ssh-rs takes care of all that and doesn't provide any updates on how it's going, I can no longer do that.
So a potential improvement to the scp API would be to either expose some of the internals of the upload as a separate lower-level API to allow hooking in like this if desired, or potentially add a version of the API which sends updates to a channel with some simple events the user can react to, e.g. details of start and finish writing each file and writing a chunk of X bytes for a given file.
The text was updated successfully, but these errors were encountered:
Maybe I can add some APIs like upload/download_with_notifier to send events via channels. Or something like upload/download_with_notify_callback to call callbacks during the process.
But this might change the current code a lot. I'll find an easiest way to approach this.
Yeah that's roughly what I had in mind; maybe an API like fn upload_with_progress(local: Path, remote: Path, notify: Channel) and you can run it async and read progress from the channel. Might need a little bit of factoring out common code but hopefully not super invasive if you just have to pass around an optional channel in the underlying stuff, for example.
Hi, just a feature request around scp. I used this project as I ran into difficulties cross-building with bindings to
libssh2
(alexcrichton/ssh2-rs#22). The APIs are very similar so it wasn't a lot of effort to swap to usingssh-rs
instead, but I did notice the scp API is higher-level in this library.I definitely appreciate the higher-level API because it allowed me to throw out 60-odd lines of low-level data-streaming code I had had to write myself with
ssh2-rs
and instead just invokescp.upload(src, dest)
, but in my case I'm uploading relatively large files which may take a few minutes to finish. To give a progress indicator to the user I used indicatif to render a nice progress bar, transfer speed, etc. by sending updates as I processed chunks. Becausessh-rs
takes care of all that and doesn't provide any updates on how it's going, I can no longer do that.So a potential improvement to the scp API would be to either expose some of the internals of the upload as a separate lower-level API to allow hooking in like this if desired, or potentially add a version of the API which sends updates to a channel with some simple events the user can react to, e.g. details of start and finish writing each file and writing a chunk of X bytes for a given file.
The text was updated successfully, but these errors were encountered: