mirror of
https://github.com/mirror/wget.git
synced 2025-01-04 09:20:48 +08:00
Take the maximum value between RETR and SIZE bytes counts for the file size
This commit is contained in:
parent
e0c0d21d9d
commit
6ef8c69c9d
@ -1,3 +1,9 @@
|
|||||||
|
2010-07-14 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
|
* ftp.c (max): Add definition.
|
||||||
|
(getftp): Consider for`expected_bytes' the greatest value between the bytes
|
||||||
|
count returned by SIZE and the bytes count returned by RETR.
|
||||||
|
|
||||||
2010-07-11 Giuseppe Scrivano <gscrivano@gnu.org>
|
2010-07-11 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
* http.c (http_loop): New variable `force_full_retrieve'. If the remote
|
* http.c (http_loop): New variable `force_full_retrieve'. If the remote
|
||||||
|
@ -63,6 +63,8 @@ as that of the covered work. */
|
|||||||
#define LIST_FILENAME ".listing"
|
#define LIST_FILENAME ".listing"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define max(a, b) ((a > b) ? (a) : (b))
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int st; /* connection status */
|
int st; /* connection status */
|
||||||
@ -1019,7 +1021,9 @@ Error in server response, closing control connection.\n"));
|
|||||||
|
|
||||||
if (!opt.server_response)
|
if (!opt.server_response)
|
||||||
logputs (LOG_VERBOSE, _("done.\n"));
|
logputs (LOG_VERBOSE, _("done.\n"));
|
||||||
expected_bytes = ftp_expected_bytes (ftp_last_respline);
|
|
||||||
|
expected_bytes = max (ftp_expected_bytes (ftp_last_respline),
|
||||||
|
expected_bytes);
|
||||||
} /* do retrieve */
|
} /* do retrieve */
|
||||||
|
|
||||||
if (cmd & DO_LIST)
|
if (cmd & DO_LIST)
|
||||||
@ -1065,7 +1069,8 @@ Error in server response, closing control connection.\n"));
|
|||||||
}
|
}
|
||||||
if (!opt.server_response)
|
if (!opt.server_response)
|
||||||
logputs (LOG_VERBOSE, _("done.\n"));
|
logputs (LOG_VERBOSE, _("done.\n"));
|
||||||
expected_bytes = ftp_expected_bytes (ftp_last_respline);
|
expected_bytes = max (ftp_expected_bytes (ftp_last_respline),
|
||||||
|
expected_bytes);
|
||||||
} /* cmd & DO_LIST */
|
} /* cmd & DO_LIST */
|
||||||
|
|
||||||
if (!(cmd & (DO_LIST | DO_RETR)) || (opt.spider && !(cmd & DO_LIST)))
|
if (!(cmd & (DO_LIST | DO_RETR)) || (opt.spider && !(cmd & DO_LIST)))
|
||||||
|
Loading…
Reference in New Issue
Block a user