wget: check for close success; fix chunked; do not bother to send QUIT to ftp

Also, random fixes to use %u for unsigned quantities. -14 bytes in wget.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-12-11 12:36:10 +01:00
parent 4662de0511
commit a3aa3e3095
6 changed files with 40 additions and 36 deletions

View File

@@ -1021,7 +1021,7 @@ static void send_headers(int responseNum)
strftime(tmp_str, sizeof(tmp_str), RFC1123FMT, gmtime(&last_mod));
#if ENABLE_FEATURE_HTTPD_RANGES
if (responseNum == HTTP_PARTIAL_CONTENT) {
len += sprintf(iobuf + len, "Content-Range: bytes %"OFF_FMT"d-%"OFF_FMT"d/%"OFF_FMT"d\r\n",
len += sprintf(iobuf + len, "Content-Range: bytes %"OFF_FMT"u-%"OFF_FMT"u/%"OFF_FMT"u\r\n",
range_start,
range_end,
file_size);
@@ -1032,7 +1032,7 @@ static void send_headers(int responseNum)
#if ENABLE_FEATURE_HTTPD_RANGES
"Accept-Ranges: bytes\r\n"
#endif
"Last-Modified: %s\r\n%s %"OFF_FMT"d\r\n",
"Last-Modified: %s\r\n%s %"OFF_FMT"u\r\n",
tmp_str,
"Content-length:",
file_size