cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Metalink support patch for curl

From: Tatsuhiro Tsujikawa <tatsuhiro.t_at_gmail.com>
Date: Wed, 9 May 2012 00:28:30 +0900

On Mon, May 7, 2012 at 1:18 AM, Tatsuhiro Tsujikawa
<tatsuhiro.t_at_gmail.com> wrote:
> 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?
>

I included above change in the attached patch.
I also fixed the issue when content-type has parameters. Now you can download
http://openoffice.mirrorbrain.org/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz.metalink

The cumulative patch attached.

If you prefer the one-commit patch to cumulative patches, I'll squash
the changes into one.

Best regards,

Tatsuhiro Tsujikawa

>> 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

Received on 2012-05-08