mirror of
https://github.com/1Remote/1Remote.git
synced 2026-04-25 13:36:03 +03:00
[GH-ISSUE #828] Redesign (S)FTP asynchronous processing #2591
Labels
No labels
area-configuration
area-ct-app
area-ct-rdp
area-ct-remoteapp
area-ct-ssh
area-ct-vnc
area-launcher
area-list
area-tags
area-teamwork
bug
chore
dependencies
general-build/ci
general-performance
general-refactor
general-security
general-supportive
general-ux
meta-documentation
meta-enhancement
meta-enhancement
meta-feature
meta-help-wanted
meta-unknown-error
priority-hi
priority-low
pull-request
question
resolution-duplicate
resolution-invalid
resolution-wontfix
stale
task-put-off
task-still-considering
task-working-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/1Remote#2591
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @itagagaki on GitHub (Jan 6, 2025).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/828
Originally assigned to: @itagagaki on GitHub.
I installed File Manager on my Google Pixel 8 (Android 15) and started the FTP server function and tried to connect from 1Remote, but it doesn't work.
The
devicefolder in the root directory is visible. However, an error message appears at the bottom of the window. It may be one of the following, although it varies from time to time.*The last one is on multiple lines, but the display area is for one line, so it protrudes a bit.
Error messages may not be displayed. When this happens, it is displayed as
ls /However, in any case, when I double-click on
device, I get the same error and cannot access the directory.Note that WinSCP can access the same protocol/address/port without any problems.
@VShawn commented on GitHub (Jan 7, 2025):
I am not able to proceed this ticket as I do not have an Android device.
@itagagaki commented on GitHub (Jan 7, 2025):
I will analyze this.
@itagagaki commented on GitHub (Jan 7, 2025):
First, I monitored the network traffic.
For 1Remote, it was as follows.
It sends the
TYPEcommand many times before logging in (presumably it appears to be done before each command is executed), and each time it is rejected. I'm not sure, but "One or more errors occurred.” might mean these responses. And this could be the reason why 1Remote does not work afterwards.Or it may simply be that this FTP server does not support the
EPSVcommand, which is why it is not available on 1Remote.For the same FTP server, WinSCP worked as follows.
Next, to resolve this issue, we also need to investigate 1Remote's built-in FTP runner and related codes.
Any advice on where to look?
@itagagaki commented on GitHub (Jan 8, 2025):
It may send a
PASVbefore logging in. In this case, the server will still respond with530 Login incorrect, but 1Remote will continue to sendPASVfor many time after that.@itagagaki commented on GitHub (Jan 8, 2025):
Okay, the following patch may be a workaround to avoid errors immediately after connection.
However, it still cannot access the subdirectory. The message "ls /: Arithmetic operation resulted in an overflow." is shown.
I will continue the analysis.
@itagagaki commented on GitHub (Jan 9, 2025):
Okay, I found the cause of the "Arithmetic operation resulted in an overflow" error and fixed it.
Now I can connect to the FTP server and browse any remote directory.
But there is still a problem. It cannot download a file. The download starts, but the progress stays at zero and eventually times out. Strangely, if the file already exists at the download destination, the download proceeds normally and the file is overwritten.
I think it's a problem with
_ftp.DownloadFile()or the way it's used, but I don't know how to resolve it yet.@itagagaki commented on GitHub (Jan 11, 2025):
When downloading a file, if a file with the same name exists in the destination folder, it can be downloaded, otherwise it fails.
This seems to be a permissions issue.
In the case of failure, after loading
C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\6.0.36\Accessibility.dll, aSystem.AggregateExceptionis thrown inSystem.Private.CoreLib.dll.I don't know how to get around it.
@itagagaki commented on GitHub (Jan 11, 2025):
More analysis is needed, but one thing has emerged.
_ftp.Connect()inTransmitterFtp.InitClient()must be changed toawait _ftp.Connect().If not, the main thread goes charging on.
(The delay I wrote earlier helps a bit, but is not the right solution).
To do this,
InitClientmust be changed toasyncand thelockmust be removed.@VShawn can you tell me what the intent of this
lockis?@VShawn commented on GitHub (Jan 12, 2025):
I think https://github.com/sshnet/SSH.NET
Is this exception thrown by
Renci.SshNet? If so, we can seek help at https://github.com/sshnet/SSH.NET.I don't have any recollection of this lock; it's from very early code. And from the context, it seems that this lock is intended to prevent duplicate init of connection and to address issues related to concurrent calls.
github.com/1Remote/1Remote@785042a37b (diff-ac81bd4867)