[En-Nut-Discussion] NutTcpStateActiveOpenEvent fails for "tiny" connections

Malte Marwedel m.marwedel at onlinehome.de
Wed Jan 27 12:01:09 CET 2010


Harald Kipp schrieb:
> Answer: I found only very few FTP clients working reliable . A few weeks
> ago I discovered, that Nut/OS FTP violates the RFC. It opens the
> listening port before a transfer command, but should open it immediately
> after the PASV command.
Ha, that was exactly I found out too, while analyzing why Firefox and 
Konqueror
could not be used as FTP client.

> - Some clients don't care, those I found reliable.
> - Some fall back to ACTIVE mode or do not use PASSIV mode by default.
Yes, I found out that Firefox does not support ACTIVE, but Konqueror can 
be set to use ACTIVE (however, then it uses it always).

I came to the conclusion, that PASSIV would require a second thread in 
the ftpd, in order to work as expected.

> Those I found unreliable and probably I experienced the problem you
> discovered.
> - Some simply break the connection.
Yes. For Konqueror, I figured out, it wants to get the files beginning 
with '.' in order to work. It first tries "list -la" and then "list". I 
added support for "list -a" and now it shows the files.
(I added support for RNFR and RNTO too).

Moreover it looks like some clients try to GET directories. For normal 
FTP servers this immediately fails, Nut/OS first says ok and then fails. 
I think, I fixed that too. I will publish the changes if I am satisfied 
with the results.

>
> I'm not yet sure, if your solution will completely fix it. But it is
> definitely required.
>
> And don't tell us, you are not familiar with the TCP state machine! This
> was excellent detective work.
Well I simply put printf outputs in the function which failed and looked 
what
sub function failed there. Repeating the steps until I was from 
NutFtoTransferFile in
NutTcpStateActiveOpenEvent.

Malte



More information about the En-Nut-Discussion mailing list