summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-04-17 12:43:54 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-17 12:43:54 +0200
commit2aeb201c9751d4ee82978c623310e14b9e831b94 (patch)
tree3f4d72e70d39889e981de68b56799ee2bf85ce78 /networking/wget.c
parent816d8d7a668b541cee99469edb90e4917ea11c3e (diff)
downloadbusybox-w32-2aeb201c9751d4ee82978c623310e14b9e831b94.tar.gz
busybox-w32-2aeb201c9751d4ee82978c623310e14b9e831b94.tar.bz2
busybox-w32-2aeb201c9751d4ee82978c623310e14b9e831b94.zip
libbb: new option FEATURE_ETC_SERVICES: if off, /etc/services reads often avoided
In practice, "wget http://host.com/" always uses port 80. People explicitly set non-standard ports via options or parameters ("telnet 1.2.3.4 567" or "telnet 1.2.3.4 ftp") instead of modifying /etc/services. function old new delta telnet_main 1466 1464 -2 rdate_main 215 198 -17 fakeidentd_main 269 252 -17 parse_url 459 392 -67 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-103) Total: -103 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 2650b5384..b6c76e9dc 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -505,23 +505,23 @@ static void parse_url(const char *src_url, struct host_info *h)
505 *p = '\0'; 505 *p = '\0';
506 h->host = p + 3; 506 h->host = p + 3;
507 if (strcmp(url, P_FTP) == 0) { 507 if (strcmp(url, P_FTP) == 0) {
508 h->port = bb_lookup_port(P_FTP, "tcp", 21); 508 h->port = bb_lookup_std_port(P_FTP, "tcp", 21);
509 } else 509 } else
510#if SSL_SUPPORTED 510#if SSL_SUPPORTED
511# if ENABLE_FEATURE_WGET_HTTPS 511# if ENABLE_FEATURE_WGET_HTTPS
512 if (strcmp(url, P_FTPS) == 0) { 512 if (strcmp(url, P_FTPS) == 0) {
513 h->port = bb_lookup_port(P_FTPS, "tcp", 990); 513 h->port = bb_lookup_std_port(P_FTPS, "tcp", 990);
514 h->protocol = P_FTPS; 514 h->protocol = P_FTPS;
515 } else 515 } else
516# endif 516# endif
517 if (strcmp(url, P_HTTPS) == 0) { 517 if (strcmp(url, P_HTTPS) == 0) {
518 h->port = bb_lookup_port(P_HTTPS, "tcp", 443); 518 h->port = bb_lookup_std_port(P_HTTPS, "tcp", 443);
519 h->protocol = P_HTTPS; 519 h->protocol = P_HTTPS;
520 } else 520 } else
521#endif 521#endif
522 if (strcmp(url, P_HTTP) == 0) { 522 if (strcmp(url, P_HTTP) == 0) {
523 http: 523 http:
524 h->port = bb_lookup_port(P_HTTP, "tcp", 80); 524 h->port = bb_lookup_std_port(P_HTTP, "tcp", 80);
525 h->protocol = P_HTTP; 525 h->protocol = P_HTTP;
526 } else { 526 } else {
527 *p = ':'; 527 *p = ':';