cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: [PATCH] Metalink URL type filtering and test fix

From: Tatsuhiro Tsujikawa <tatsuhiro.t_at_gmail.com>
Date: Tue, 2 Oct 2012 00:31:47 +0900

Hi,

On Mon, Sep 17, 2012 at 11:42 PM, Tatsuhiro Tsujikawa
<tatsuhiro.t_at_gmail.com> wrote:
> Hi,
>
> I attached 2 patches to fixes the bugs.
>
> 0001:
> In Metalink v3, the type attribute of url element indicates the
> type of the resource the URL points to. It can include URL to the
> meta data, such as BitTorrent metainfo file. In Curl, we are not
> interested in these meta data URLs. Instead, we are only
> interested in the HTTP and FTP URLs. This change filters out
> non-HTTP and FTP URLs. If we don't filter out them, it will be
> downloaded by curl and hash check will fail if hash is provided
> and next URL will be tried. This change will cut this useless
> network transfer.
>
> You can see this bug using Ubuntu metalink.
>
> When you run:
> $ curl --metalink
> http://releases.ubuntu.com/12.04/ubuntu-12.04.1-server-amd64.metalink
>
> Since the metalink file contains url element with type "bittorrent" in
> highest priority,
> curl first picks this up and after its download, hash check will fail
> and next URL will be tried.
>
> With this patch, bittorrent type URL will be ignored and curl starts
> with the valid URL.
>

Is there any possibility to apply this patch in the next release?
I know curl dev is feature freeze now, but this patch is bug fix so I think
it is eligible to merge.
Of course, I respect the decision of curl community. If there is something
to improve my patch, let me know. I'll update it as soon as possible.

> 0002:
> This is not related to 0001. But I found this when running tests
> using keyword Metalink.
>
> Updated expected output to include hash name to test2006.
>
> This change was made in b3d72a95be, but test2006 was not updated.
> This patch fixes this bug.
>

I observed that the same fix has been pushed to the master branch.

Best regards,

Tatsuhiro Tsujikawa

> Best regards,
>
> Tatsuhiro Tsujikawa
-------------------------------------------------------------------
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-10-01