3 ms·
Oh, I personally have seen an FTP protocol, and it's not simple at all. The actual data transfer is set up in a completely bonkers way, be it in active or passi
by Joker_vD 2y ago
Oh, I personally have seen an FTP protocol, and it's not simple at all. The actual data transfer is set up in a completely bonkers way, be it in active or passive mode. Even if you really, really need two separate connections for commands and for data (spoilers: you actually don't), why not have it done like this:
* client connects to ftp-server:22
> STOR ~/newfile.txt <CR><LF>
< 227 server-generated-magical-cookie-nonce <CR><LF>
* client again connects to ftp-server:22
> DATA server-generated-magical-cookie-nonce <CR><LF>
< 225 <CR><LF>
> ...binary data follows
And never mind all the cruft needed to support OSes that pre-date UNIX or, in fact, TCP's wide adoption. Seriously, 99% of the time all the upload functionality you want is equivalent to
<newfile.txt ssh ftp-server 'cat >newfile.txt'
The 1 remaining percent is upload resumption.