curl-users
[PATCH] Metalink URL type filtering and test fix
Date: Mon, 17 Sep 2012 23:42:42 +0900
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.
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.
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
- application/octet-stream attachment: 0001-tool_metalink.c-Filtered-resource-URLs-by-type.patch
- application/octet-stream attachment: 0002-metalink-tests-Updated-expected-output-to-include-ha.patch