summaryrefslogtreecommitdiff
path: root/networking/ftpgetput.c
diff options
context:
space:
mode:
authorGlenn L McGrath2003-12-20 01:47:18 +0000
committerGlenn L McGrath2003-12-20 01:47:18 +0000
commitffccf6eb5de311a3db8c3d7f7496e2f0cad69a23 (patch)
tree859f5849c30de6cb69bf6336af6d2228402f2395 /networking/ftpgetput.c
parent03d8091859f45a6bb5e3aadc110b279e789399f2 (diff)
downloadbusybox-ffccf6eb5de311a3db8c3d7f7496e2f0cad69a23.zip
busybox-ffccf6eb5de311a3db8c3d7f7496e2f0cad69a23.tar.gz
Change interface to bb_lookup_host, dont try and set port inside this
function as there is no gracefull way of handling failures. Rename bb_getport to bb_lookup_port, allow a default port to be specified so it always returns a correct value. Modify ftpgetput/rdate/wget to use the new interface. wget/rdate now use etc/services with a falback default value.
Diffstat (limited to 'networking/ftpgetput.c')
-rw-r--r--networking/ftpgetput.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 8724739..cc7a2a7 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -356,7 +356,8 @@ int ftpgetput_main(int argc, char **argv)
* and we want to connect to only one IP... */
server->s_in = &s_in;
server->host = argv[optind];
- bb_lookup_host(&s_in, server->host, NULL);
+ bb_lookup_host(&s_in, server->host);
+ s_in.sin_port = bb_lookup_port(server->port, 21);
if (verbose_flag) {
fprintf(stdout, "Connecting to %s[%s]:%s\n",
server->host, inet_ntoa(s_in.sin_addr), server->port);