aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-03 22:29:01 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-03 22:29:01 +0000
commita8951cbc34c83fc73e3a3e271e6026b43b51690b (patch)
tree07bd064c19d6a49678e542fd40ff91c99a8f73d0 /networking/wget.c
parent919c10dd8884aa4876ec6ca407a12f3793f2bab1 (diff)
downloadbusybox-w32-a8951cbc34c83fc73e3a3e271e6026b43b51690b.tar.gz
busybox-w32-a8951cbc34c83fc73e3a3e271e6026b43b51690b.tar.bz2
busybox-w32-a8951cbc34c83fc73e3a3e271e6026b43b51690b.zip
wget: always print port# in 'Host' header (smaller code)
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/networking/wget.c b/networking/wget.c
index bca66f822..ee5aa63e9 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -272,15 +272,8 @@ int wget_main(int argc, char **argv)
272 fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path); 272 fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path);
273 } 273 }
274 274
275 { 275 fprintf(sfp, "Host: %s:%u\r\nUser-Agent: %s\r\n",
276 const char *portstr = ""; 276 target.host, target.port, user_agent);
277 if (target.port != 80)
278 portstr = xasprintf(":%d", target.port);
279 fprintf(sfp, "Host: %s%s\r\nUser-Agent: %s\r\n",
280 target.host, portstr, user_agent);
281 if (ENABLE_FEATURE_CLEAN_UP && target.port != 80)
282 free((char*)portstr);
283 }
284 277
285#if ENABLE_FEATURE_WGET_AUTHENTICATION 278#if ENABLE_FEATURE_WGET_AUTHENTICATION
286 if (target.user) { 279 if (target.user) {