diff options
author | Denis Vlasenko | 2007-01-03 22:29:01 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-01-03 22:29:01 +0000 |
commit | a8951cbc34c83fc73e3a3e271e6026b43b51690b (patch) | |
tree | 07bd064c19d6a49678e542fd40ff91c99a8f73d0 /networking | |
parent | 919c10dd8884aa4876ec6ca407a12f3793f2bab1 (diff) | |
download | busybox-a8951cbc34c83fc73e3a3e271e6026b43b51690b.zip busybox-a8951cbc34c83fc73e3a3e271e6026b43b51690b.tar.gz |
wget: always print port# in 'Host' header (smaller code)
Diffstat (limited to 'networking')
-rw-r--r-- | networking/wget.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/networking/wget.c b/networking/wget.c index bca66f8..ee5aa63 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -272,15 +272,8 @@ int wget_main(int argc, char **argv) fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path); } - { - 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); - } + fprintf(sfp, "Host: %s:%u\r\nUser-Agent: %s\r\n", + target.host, target.port, user_agent); #if ENABLE_FEATURE_WGET_AUTHENTICATION if (target.user) { |