projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
562dc24
)
wget: print port# in 'Host' header, if different from 80
author
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 3 Jan 2007 22:09:26 +0000
(22:09 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 3 Jan 2007 22:09:26 +0000
(22:09 -0000)
networking/wget.c
patch
|
blob
|
history
diff --git
a/networking/wget.c
b/networking/wget.c
index fbdbf62f61ba26252f3f622eff4602d659e4f00f..bca66f822f804919bf67d9c31bc77b94d7dd0b1d 100644
(file)
--- a/
networking/wget.c
+++ b/
networking/wget.c
@@
-272,8
+272,15
@@
int wget_main(int argc, char **argv)
fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path);
}
- fprintf(sfp, "Host: %s\r\nUser-Agent: %s\r\n", target.host,
- user_agent);
+ {
+ const char *portstr = "";
+ if (target.port != 80)
+ portstr = xasprintf(":%d", target.port);
+ fprintf(sfp, "Host: %s%s\r\nUser-Agent: %s\r\n",
+ target.host, portstr, user_agent);
+ if (ENABLE_FEATURE_CLEAN_UP && target.port != 80)
+ free((char*)portstr);
+ }
#if ENABLE_FEATURE_WGET_AUTHENTICATION
if (target.user) {