ftp: Import NetBSD's latest version. Move determination of socket buffer sizes from startup to the first time a socket is used, as the previous logic assumed AF_INET sockets were available (which they may not be in an IPv6-only system). Use __dead Fix warnings. Obtained-from: NetBSD
Snyc tnftp with NetBSD: Fix numerous WARNS issues. Rename internal getline() function to get_line() to prevent conflicts. Rename argument from "bool" to "val". Parse HTTP 'Date' entries in the `C' locale rather than the user's. Avoid NULL dereference in log output if the command line parser failed to extract a port number from the URL. Use AF_INET instead of AF_UNSPEC as the default family if !defined(INET6). In ftpvis(), prevent incomplete escape sequences at end of dst, and ensure NUL-termination of dst. Also tweak for readibility.
Sync with NetBSD: Use the service name to getaddrinfo() (along with the host name), so that features such as DNS Service Discovery have a better chance of working. Display the service name in various status & error messages. Don't getservbyname() the :port component of a URL; RFC 3986 says it's just an unsigned number, not a service name. Only attempt to el_parse() a command unknown by the default parser if editing is enabled. Fixes NetBSD PR bin/38589 Add epsv6 and epsv to disable extended passive mode for ipv6 or both ipv4 and ipv6 respectively.