On Sat, Nov 02 2019, Klemens Nanni <k...@openbsd.org> wrote: > On Sat, Nov 02, 2019 at 12:32:09PM +0100, Jeremie Courreges-Anglas wrote: >> ftp(1) is not nc(1), I'd be surprised if our current ftp(1) was ported >> to another OS. :) > Meh, stupid me. > > Diff looks good so far, I can test it with miniroot and/or bsd.rd on > amd64 and/or macppc if you want.
Thanks for the proposal. Testing on powerpc could be nice since iirc that platform doesn't use ftp-ssl. But the changes shouldn't negatively affect non-TLS connections. I have tested /usr/src/distrib/special/ftp and /usr/src/distrib/special/ftp-ssl, and I could not spot regressions. /usr/src/usr.bin/ftp fared well in a dpb -F run too. Throughput for TLS connections doesn't seem positively nor negatively affected either, the numbers don't change much even for connections to localhost. This change is really about making the code simpler and cleaner, which can't hurt when looking at fetch.c. PS: my initial diff also implemented a "closefn" function which would properly close the tls connection and the underlying fd so we could just call fclose(fin). But in the end ftp_close() lead to shorter code, and I wanted to keep the TLS session ticket logging, which looked weird in a supposedly pure close(2) wrapper. -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE