New SFTP plugin available now

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Post by *JOUBE »

Sven Giermann wrote:@JOUBE:
I did not try PSFTP, but as you quoted PSCP used sftp by default and returns the same throughput. So would like to have a '-scp' switch for our sftp-Plugin as well...
Sure, that pscp's "sftp protocol" "self checked" and "forced" is the same?

Maybe it's different.

Sure, that pscp uses in your case (with your server) in the "self check mode" the "sftp protocol"?

What's with WinSCPs transfer rates?

JOUBE
Sven Giermann
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-19, 10:42 UTC

Post by *Sven Giermann »

JOUBE wrote:Sure, that pscp uses in your case (with your server) in the "self check mode" the "sftp protocol"?
Yes, it does and the throughput is the same.
I did not know pscp's behaviour, but I saw that it's too slow, so I tried '-sftp' first with the same result and '-scp' with better results - always reproducable.

I cannot do any further checks at the moment (WinSCP) because the server is our gateway, which I sometimes use to download big files and get them later over the LAN. I deleted these files now and cannot mesaure the speed again.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have now looked at the internals of the SCP and SFTP protocols, and I understand now why SCP must be faster: With SCP, the client requests or sends a file as a single stream, all in one part. With SFTP, the client request or sends small parts of the file, all separately, which are all confirmed one by one by the server.

Therefore I have now implemented SCP uploads and downloads in my plugin, and indeed they seem to be faster with a quick client and server! You can enable this option in the connection options (Alt+Enter on a connection).

You can download the new plugin version 0.9 from the first message of this thread. This version also includes the chmod fix when creating directories, and is already prepared for the master password manager of the upcoming Total Commander 7.5 (not available in TC 7.04a yet).
Author of Total Commander
https://www.ghisler.com
CoolWater
Power Member
Power Member
Posts: 744
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

Thx Christian...

But... the SCP upload/download seems only to work when the directory/filename does not contain spaces...

Regards,
CoolWater
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Post by *JOUBE »

ghisler(Author) wrote:You can download the new plugin version 0.9 from the first message of this thread. This version also includes the chmod fix when creating directories, and is already prepared for the master password manager of the upcoming Total Commander 7.5 (not available in TC 7.04a yet).
Thank you for the update.

And thank you, that it is possible to set up a path on the server in the configuration for connections. But it's better, I think, to have this path in a separate field on the configuration page, like it is in the ftp modul of tc.
ghisler(Author) wrote:I have now implemented SCP uploads and downloads in my plugin
And now "it's a small step for man, but a great step for the"... plugin and the user to implement the whole scp communication protocol for servers without SFTP... (No, I know, it needs some more steps.)

JOUBE
Last edited by JOUBE on 2008-11-21, 12:05 UTC, edited 1 time in total.
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Just a little remark, following part in ParseAddress() actually has a meaning. :)

Code: Select all

p=strchr(tmp, ':');
t=strrchr(tmp, ':');
if (p && p==t) {
If there's any colon present, then there are two choices:
- first and last colon are same => there's only one colon => must be port separator
- first and last colon are different => most probably numeric IPv6 without square brackets
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

Thanks Christian!

The chmod fix works very well.

I also tested SCP with the OpenSSH server that I use. I did not change any other settings (that have previously worked perfectly with SFTP) but only checked the SCP box.

Smaller files (let's say 100-200 KB) are uploaded well but with larger files -- which do not contain any spaces in the name -- (I tried with 4MB etc.) the upload started but did not finish: I got an "Error Uploading File" message. Large files (up to 22 MB) downloaded OK.

The server configuration is probably OK since when I tested with WinSCP (profile set to use only SCP), the same files uploaded without problem.

I can also confirm that files with spaces in the name cannot be neither uploaded nor downloaded (the same error message).
#68776 Personal Licence
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Convert spaces--- ?

Post by *Clo »

2andres992

:) Hello !

• Just a modest thought : Couln't the spaces in these file names be converted into hexa value %20 ? :roll:
- Or into ANSI #160 which is seen generally as a "normal" character …

:mrgreen: KR
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
Sven Giermann
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-19, 10:42 UTC

Post by *Sven Giermann »

One more "thanks" from me :)
Transfer speed is much higher now!

I cannot confirm the large file problem, but I also have the "spaces in names" Problem...
#110099
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

the SCP upload/download seems only to work when the directory/filename does not contain spaces...
I have checked that - the workaround seems to be to pass the file name in double quotes "".
larger files -- which do not contain any spaces in the name -- (I tried with 4MB etc.) the upload started but did not finish
After a long research I found that this is a bug in the libssh2 dll which was documented here:
libssh2 SCP upload issues

The bug was report already in February, but not fixed so far. The only workaround seems to be to switch from non-blocking mode to blocking mode sockets. I'm doing this now just during the transfer, and it seems to work fine for me. Please download the new beta 0.91 from the first message.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

ghisler(Author) wrote:I have checked that - the workaround seems to be to pass the file name in double quotes "".
Unfortunately, space is not the only naughty character. I was thinking about something like this:

Code: Select all

http://web.hisoftware.cz/sob/download/sftpplug_src09beta-scp-quote.patch
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

ghisler(Author) wrote:
The only workaround seems to be to switch from non-blocking mode to blocking mode sockets. I'm doing this now just during the transfer, and it seems to work fine for me. Please download the new beta 0.91 from the first message.
I tested 0.91 and uploads of larger files, which previously did not finish, were now completed correctly.

EDIT: I also noted that SFTP connections can be added to directory hotlist. However, doing it in the form:

cd \\\Secure FTP\Connection Name\

does not open the specific directory which I have set in the configuration for the respective connection (but instead opens just the site root). Not exactly a bug but I discovered that when I configure dir hotlist according the following pattern:

cd \\\Secure FTP\Connection Name\Path\on\the\Server\

everything works (i.e. the working SFTP path can be copied e.g. by opening Synchronise Dirs dialog and copying the full path of the remote directory from there). Is this intended behaviour, though?
#68776 Personal Licence
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately, space is not the only naughty character. I was thinking about something like this:
Masking double Quotes is problably not needed because Windows doesn't support file names with double quotes anyway. Did you find out what characters don't work, e.g. what about the semicolon or other separators?
I tested 0.91 and uploads of larger files, which previously did not finish, were now completed correctly.
Great!
cd \\\Secure FTP\Connection Name\Path\on\the\Server\
everything works
The CD command will always go to the real directory in the plugin shown during a connection. The connection names themselves are just links which start the connection.

cd \\\Secure FTP\Connection Name\
has to go to the root because otherwise there would be no way to go there via the cd command...
Author of Total Commander
https://www.ghisler.com
pe.ch
Junior Member
Junior Member
Posts: 2
Joined: 2008-09-17, 09:11 UTC

Post by *pe.ch »

Thank you, plugin is better and better.

Will be possible add function Download in background (separate thread) identical like in classic FTP in TC?

It will be great.

Pe.Ch
Peter Franz
Junior Member
Junior Member
Posts: 21
Joined: 2003-02-28, 10:45 UTC

Post by *Peter Franz »

pe.ch wrote:Thank you, plugin is better and better.

Will be possible add function Download in background (separate thread) identical like in classic FTP in TC?

It will be great.

Pe.Ch
+1 - please!
Peter
Post Reply