Ticket #3462 enhancement closed fixed
FTP server: upload should support async close
|Reported by:||warner||Owned by:|
|Cc:||exarkun, terrycojones, spiv||Branch:||
(diff, github, buildbot, log)
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 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:
- modify unregisterProducer to 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.