Accept metalink files specified as URLs. Better counting of the files downloaded in retrieve_from_file.

This commit is contained in:
Ilim Ugur 2012-07-25 01:05:04 +03:00
parent 9fd1e97e40
commit bb28bda88f

View File

@ -1000,7 +1000,10 @@ retrieve_from_file (const char *file, bool html, int *count)
input_file = url_file;
}
else if(metalink = metalink_context(url))
else
input_file = (char *) file;
if(metalink = metalink_context(input_file))
{
/*GSoC wget*/
char *command, **files;
@ -1148,6 +1151,7 @@ retrieve_from_file (const char *file, bool html, int *count)
}
else
{
++*count;
sprintf(command, "cat ");
j=0;
r = 4;
@ -1182,14 +1186,10 @@ retrieve_from_file (const char *file, bool html, int *count)
free(ranges);
free(thread_ctx);
*count = i;
iri_free (iri);
metalink_delete(metalink);
/*What exactly to return MUST be reconsidered.*/
return status;
}
else
input_file = (char *) file;
{
url_list = (html ? get_urls_html (input_file, NULL, NULL, iri)
: get_urls_file (input_file));
@ -1254,6 +1254,7 @@ Removing file due to --delete-after in retrieve_from_file():\n"));
/* Free the linked list of URL-s. */
free_urlpos (url_list);
}
iri_free (iri);