[Twisted-Python] ftp: LIST blocking issues
andy at thecablelounge.com
Thu Sep 16 18:20:38 EDT 2004
Andy Gayton wrote:
> I'm finding that the ftp server hangs the client when performing a LIST.
> I thought it was something to do with what I was doing, but find it
> happens with the standard tap anonymous ftp server as well.
> It looks like processCommand adds requests to a blocked queue if
> dtpInstance is None - which it is in my case:
> 2004/09/13 14:03 EST [FTP,0,127.0.0.1] 'PORT 127,0,0,1,152,65'
> 2004/09/13 14:03 EST [FTP,0,127.0.0.1] processing command ['PORT',
> 2004/09/13 14:03 EST [FTP,0,127.0.0.1] FTP.processCommand: cmd = PORT,
> args = ('127,0,0,1,152,65',)
> 2004/09/13 14:03 EST [FTP,0,127.0.0.1] FTP.processCommand: cmd PORT in
> 2004/09/13 14:03 EST [FTP,0,127.0.0.1] FTP.processCommand:
> self.dtpInstance = None
> 2004/09/13 14:03 EST [FTP,0,127.0.0.1] during dtp setup, blocked =
> [('PORT', ('127,0,0,1,152,65',))]
> I created the server with 'mktap ftp --root=/tmp' against Twisted trunk
> Is there something I'm missing?
As far as I can tell the ftp protocol is only creating a dtpInstance
when processing a PASV or PORT command. But the PORT command blocks if
there is no dtpInstance - so only passive clients can get a dtpInstance.
I used pftp to the standard tap anonymous ftp server and it works fine.
Does anyone know if this was intentional? non-passive clients did work
with Twisted r9390 and before which is fair while ago, so I'm guessing
it is .. ?
I don't know anything about the inards of the ftp protocol, so just
trying to get my head around what's going on.
Any clarification would be appreciated,
More information about the Twisted-Python