This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients eric.araujo, ezio.melotti, giampaolo.rodola, nneonneo
Date 2011-05-07.15:42:41
SpamBayes Score 2.2023128e-10
Marked as misclassified No
Message-id <1304782963.26.0.738971468316.issue12002@psf.upfronthosting.co.za>
In-reply-to
Content
This is a nasty one and mainly it's the reason why there are no tests for abort() method.
In FTP, ABOR command is supposed to be sent as OOB (out-of-band) "urgent" data and the dummy FTP server we're using for the funcional tests must handle this appopriately.

In practical terms this means that when the client calls self.sock.sendall(line, MSG_OOB) the server is supposed to call socket.recv(1024, MSG_OOB).
Since our server uses asyncore this becomes quite twisted to handle.
This can be avoided by setting SO_OOBINLINE which tells the server to handle the urgent data inline meaning that both plain and urgent data can be received with a normal sock.recv(1024) call.

The patch in attachment does this and also fixes FTP_TLS.abort() which is not able to accept the extra MSG_OOB flag argument.

There's a side note: on certain platforms SO_OOBINLINE has no effect, resulting in asyncore's handle_expt method being called, see:
http://code.google.com/p/pyftpdlib/source/browse/trunk/pyftpdlib/ftpserver.py#2064
I haven't handled this case in my patch because I'm not sure what platforms are broken.
I'd say we can commit this patch as-is, wait for the buildbots to turn red and then disable the test for those platforms afterwards.
History
Date User Action Args
2011-05-07 15:42:43giampaolo.rodolasetrecipients: + giampaolo.rodola, nneonneo, ezio.melotti, eric.araujo
2011-05-07 15:42:43giampaolo.rodolasetmessageid: <1304782963.26.0.738971468316.issue12002@psf.upfronthosting.co.za>
2011-05-07 15:42:42giampaolo.rodolalinkissue12002 messages
2011-05-07 15:42:42giampaolo.rodolacreate