curl-users
Re: Metalink support patch for curl
Date: Mon, 7 May 2012 01:18:00 +0900
On Sat, May 5, 2012 at 11:50 AM, Anthony Bryan <anthonybryan_at_gmail.com> wrote:
>>> I think the behavior of checking hash and deciding re-download is debatable
>>> to suite curl project.
>>
>>Hm. What would be the different alternatives here to select between you think?
>
> Tatsuhiro, how does aria2 behave?
>
In aria2, if -V option is given, aria2 first performs hash check in
the local file and re-download the file if hash check fails. If -V is
not given, aria2 re-download the file without hash check.
> here is another (awful) patch that adds Metalink info to man page and
> --help. awful because it includes each commit including the other one
> you already applied. :( not sure how to do a cumulative commit patch
> that isn't incremental.
>
I'm also not sure how to do this using git-format-patch.
One way to do this is use git-log with -p option.
> Daniel said we want --metalink option in --help even if it not
> available, so I added it.
>
Thanks. I merged your changes.
> I would have added Metalink to "Features" for --version output but
> wasn't totally sure I could get it right. could you do that? it would
> help during testing to know if it's been enabled correctly.
>
I checked the code and found that the names in "Features" come from
curlinfo->features, which
come from libcurl.
But Metalink is not libcurl feature, but curl tool feature. So I think
it is not possible to add
Metalink in curlinfo->features. The simple way to add Metalink to
Features is just
add printf with HAVE_LIBMETALINK guard (sorry, another ifdef!):
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 641334f..a07c671 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -1566,6 +1566,9 @@ ParameterError getparameter(char *flag, /* f or -long-f
if(curlinfo->features & feats[i].bitmask)
printf("%s ", feats[i].name);
}
+#ifdef HAVE_LIBMETALINK
+ printf("Metalink ");
+#endif /* HAVE_LIBMETALINK */
puts(""); /* newline */
}
}
Are there any better alternatives?
> could you have your changes available on github or somewhere, please?
> I think that would make it easier to try out and we can always find
> the latest version easily.
>
I could, but the problem is when I published my local repository, then
I could not
rebase my repo to the latest curl master branch.
I attached the cumulative patch set for Metalink support so far.
Best regards,
Tatsuhiro Tsujikawa
> thank you!
> --
> (( Anthony Bryan ... Metalink [ http://www.metalinker.org ]
> )) Easier, More Reliable, Self Healing Downloads
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/x-bzip2 attachment: metalink-patch.tar.bz2