0 votes
by (2.3k points)

When KeepAliveDuringTransfer is enabled and a connection is made to Wing FTP Server (v8.2.5 for Windows), an upload error occurs if a KeepAlive signal is sent during the upload process.
Sending a NOOP command results in the following server response:
"Another command is pending currently, please try again later (451)"

Currently, Rebex FTP 8.0 recognizes the message "Another command is currently pending" as a success, but it fails to recognize "Another command is pending currently."

It would be better to implement a more flexible check.
For example:
StartWith("Another command") && StartWith("pending")

Thank you

Applies to: Rebex FTP/SSL

1 Answer

+1 vote
by (79.1k points)
selected by
 
Best answer

When KeepAliveDuringTransfer is enabled, the server can reply with anything. To ensure that the FTP client does not mask a legitimate transfer error, we ignore only well known error messages. The "Another command is currently pending" message was observed with a particular server, so it is supported. The message "Another command is pending currently" has not been observed yet.

Support for this message will be added in the next version.

by (2.3k points)
In that case, is there a way to ignore KeepAlive errors that might occur during upload or download and simply continue the process?
by (79.1k points)
No, it cannot be ignored. Unfortunately, this isn't something the client can reliably do, and the root cause lies in the design of the FTP protocol itself.

During a transfer, the FTP control connection is shared between the transfer command (STOR/RETR) and any other commands. The protocol doesn't expect new commands to be sent while a transfer is in progress, so the behavior is server-specific:

- Some servers silently accept NOOP and reply 200 OK.
- Some servers reject it with a 4xx or 5xx error, in a wording of their own choosing.
- Some servers delay the reply until the transfer completes.

FTP replies carry no command identifier, so the client can only match them to commands by their order. Whenever the server replies with an error, the client has to decide whether it is the answer to the NOOP, or the final result of the transfer itself (for example 451 Local error in processing, 426 Connection closed; transfer aborted, 552 Disk quota exceeded). The only way to tell them apart is by the text of the message, which is not standardized, and often not even by the reply code, since many servers use the same code (e.g. 451) for both situations.

If we ignored all errors received after a KeepAlive (NOOP), we would also swallow real transfer failures. The upload could then be reported as successful even though the file on the server is incomplete or missing. That is silent data loss, which is much worse than a spurious exception, so we deliberately ignore only the messages we know to be harmless.

Possible solutions:

1. Disable `KeepAliveDuringTransfer`. This is the safest choice and works with every server. It is only needed if your firewall or the server drops idle control connections during very long transfers.
2. Keep it enabled only for servers where it is known to work, and disable it for Wing FTP Server.
3. We can send you preview build with support for this message.
by (2.3k points)
Thank you.
I have modified it to disable the feature for Wing FTP Server.
There is no need to send a preview build; I plan to apply all the changes at once in the next official patch.
...