[Twisted-Python] ftp: LIST blocking issues

Jonathan Simms slyphon at twistedmatrix.com
Sun Sep 19 15:22:02 MDT 2004


Andy Gayton wrote:

> 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', 
>> '127,0,0,1,152,65']
>> 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 blockingCommands
>> 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 r11660
>>
>> 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,
>
> cheers,
>
> Andy.
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Well, basically, ftp is broken in subtle ways.  IIRC, the support for 
the PORT command was iffy at best.

The best thing you can do is go to twistedmatrix.com and file a bug 
report. The protoocol is in the middle of yet-another rewrite, and 
having this issue in the bug-tracker will help to make sure that it gets 
fixed.

-Jonathan Simms









More information about the Twisted-Python mailing list