FTP server: upload should support async close
|Reported by:||warner||Owned by:|
|Cc:||Jean-Paul Calderone, terrycojones, spiv||Branch:||
branch-diff, diff-cov, branch-cov, buildbot
As discussed on the mailing list, the FTP server in current trunk (r24958) does not have a mechanism for handling uploads that are not complete the moment the last byte is accepted by the consumer. This makes it difficult, for example, to implement an FTP frontend on a virtual filesystem that takes some amount of time/work to finish the upload process.
The proposed solution is to enhance [source:trunk/twisted/protocols/ftp.py#L1424 ftp:IWriteFile] to add a
close() method, which will be called after the consumer has been disconnected, but before the '226 Transfer Complete' response is sent.
close() can return a Deferred, and the response will not be sent until after it fires. The value produced by this Deferred is ignored.
Other proposed solutions were:
unregisterProducerto allow it to return a Deferred
- do something at the VFS level
A patch to implement this change is attached. It does not yet have specific test coverage, but of course the existing tests still pass.
Change History (14)
comment:1 Changed 8 years ago by
|Cc:||Jean-Paul Calderone added|
|Owner:||changed from itamarst to warner|
comment:2 Changed 7 years ago by
|Priority:||normal → highest|