mikaelliljedahl / freesftpsharp

SFTP server with Web Admin GUI based on FxSSH
MIT License
20 stars 3 forks source link

Sftp can't upload big files #5

Closed EbeyH closed 1 year ago

EbeyH commented 1 year ago

After window packet size has end, end SSH_WINDOW_ADJUST has sent. I received 1 or 2 unparsed messages. And upload fails.

mikaelliljedahl commented 1 year ago

Which client software are you using? You can upload small files but not larger ones? What is big? 1 Mb or 1 Gb? Is the SSH_WINDOW_ADJUST related to the upload big files problem?

EbeyH commented 1 year ago

Over 1mb. from what I saw it depends on maxWindowSize in window adjust definition. I'm using filezilla client and core ftp(winScp isn't work good but this is another problem)

On Thu, Apr 20, 2023, 15:47 Mikael Liljedahl @.***> wrote:

Which client software are you using? You can upload small files but not larger ones? What is big? 1 Mb or 1 Gb? Is the SSH_WINDOW_ADJUST related to the upload big files problem?

— Reply to this email directly, view it on GitHub https://github.com/mikaelliljedahl/freesftpsharp/issues/5#issuecomment-1516267915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBYKOQXEM675TNWHWM73TLXCEV7HANCNFSM6AAAAAAXFMIVKI . You are receiving this because you authored the thread.Message ID: @.***>

EbeyH commented 1 year ago

And yes. After I sent the WindowAdjustMessage, I get some 1 or 2 sftp unparsed messages with small size than usual

On Thu, Apr 20, 2023, 15:56 Ebay Eliav @.***> wrote:

Over 1mb. from what I saw it depends on maxWindowSize in window adjust definition. I'm using filezilla client and core ftp(winScp isn't work good but this is another problem)

On Thu, Apr 20, 2023, 15:47 Mikael Liljedahl @.***> wrote:

Which client software are you using? You can upload small files but not larger ones? What is big? 1 Mb or 1 Gb? Is the SSH_WINDOW_ADJUST related to the upload big files problem?

— Reply to this email directly, view it on GitHub https://github.com/mikaelliljedahl/freesftpsharp/issues/5#issuecomment-1516267915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBYKOQXEM675TNWHWM73TLXCEV7HANCNFSM6AAAAAAXFMIVKI . You are receiving this because you authored the thread.Message ID: @.***>

mikaelliljedahl commented 1 year ago

Inside FxSsh.Session these 2 constants are declared

    internal const int InitialLocalWindowSize = LocalChannelDataPacketSize * 32;
    internal const int LocalChannelDataPacketSize = 1024 * 32;

InitialLocalWindowSize is pretty much exactly 1 Mb.

The implementation originally came from: https://github.com/0xFireball/SSHServer/blob/master/FxSsh/Services/Channel.cs and related https://github.com/0xFireball/SSHServer/blob/master/FxSsh/Messages/Connection/ChannelWindowAdjustMessage.cs

Maybe method ClientAdjustWindow or method ServerAttemptAdjustWindow is involved in changing the window size but I actually don't have a clue what to change to get it to work.

BR Mikael

mikaelliljedahl commented 1 year ago

I made a litte test and changing the InitialLocalWindowSize constant did the trick. I could successfully upload a 30 Mb file using FileZilla. I have updated the repo.

EbeyH commented 1 year ago

Thanks I'll check next week.