Giter Club home page Giter Club logo

Comments (2)

fclairamb avatar fclairamb commented on August 22, 2024

I didn't know this command existed. You're becoming quite the FTP expert!

This adds only more madness to the FTP protocol. I find it very strange to interrupt the synchronous flow of commands with asynchronous ones. This means that if a few commands are passed synchronously. Do you know any server that supports this command? I'd like to see how they handle the queuing of synchronous commands.

My goal is to make this library the most featured one, so we might as well support it.

How do you see this?

It seems like the cleanest implementation would be to properly use Context throughout the API but at the same time as the afero.Fs API doesn't support it so he actual use-cases of having something to interrupt are pretty limited.

The way I see it is that we could:

  • Mark a few commands as being "abortable"
  • Once any of these commands are run, a context is initialized on the current connection and the command is run on another goroutine
  • We continue to read commands. If we receive an ABOR, we cancel the context and that shall close the current connection on the current command execution. If we receive something else thanABOR, we can put it in a queue of commands and parse each of them at the end of the main command execution.

from ftpserverlib.

drakkan avatar drakkan commented on August 22, 2024

Hi,

I think ABOR is supported by many, if not all, FTP servers.

For what I understand from reading the specs FTP commands are generally sequential. But there are some command that require "special actions". These commands are ABOR, STAT, QUIT.

pyftpdlib code should be easier to follow than ProFTPD or Pure-FTPd.

Regarding ABOR handling this is an extract from the specs

This command tells the server to abort the previous FTP
service command and any associated transfer of data.  The
abort command may require "special action", as discussed in
the Section on FTP Commands, to force recognition by the
server.  No action is to be taken if the previous command
has been completed (including data transfer).  The control
connection is not to be closed by the server, but the data
connection must be closed.

There are two cases for the server upon receipt of this
command: (1) the FTP service command was already completed,
or (2) the FTP service command is still in progress.

In the first case, the server closes the data connection
(if it is open) and responds with a 226 reply, indicating
that the abort command was successfully processed.

In the second case, the server aborts the FTP service in
progress and closes the data connection, returning a 426
reply to indicate that the service request terminated
abnormally.  The server then sends a 226 reply,
indicating that the abort command was successfully
processed.

I'll try to implement this feature, but I'm quite busy in this period, it could require some time

from ftpserverlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.