2010-02-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Added Metalink4 support. Currently, name attribute of
	metalink::metaurl is ignored and multi-file torrent cannot be used
	with Metalink4.
	* doc/aria2c.1.txt
	* src/DownloadHandlerConstants.cc
	* src/ExpatMetalinkProcessor.cc
	* src/Makefile.am
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkParserController.cc
	* src/MetalinkParserController.h
	* src/MetalinkParserState.h
	* src/MetalinkParserStateImpl.cc
	* src/MetalinkParserStateImpl.h
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/MetalinkParserStateV3Impl.cc
	* src/MetalinkParserStateV3Impl.h
	* src/MetalinkParserStateV4Impl.cc
	* src/MetalinkParserStateV4Impl.h
	* src/MetalinkResource.cc
	* src/MetalinkResource.h
	* src/Metalinker.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/XML2SAXMetalinkProcessor.cc
	* src/messageDigest.cc
	* src/util.cc
	* src/util.h
	* test/Makefile.am
	* test/MetalinkEntryTest.cc
	* test/MetalinkParserControllerTest.cc
	* test/MetalinkProcessorTest.cc
	* test/MetalinkerTest.cc
	* test/UtilTest.cc
	* test/metalink4-attrs.xml
	* test/metalink4-dirtraversal.xml
	* test/metalink4.xml
This commit is contained in:
Tatsuhiro Tsujikawa 2010-02-25 14:40:18 +00:00
parent fa6fd758af
commit 3880a5f71b
41 changed files with 2290 additions and 928 deletions

View file

@ -27,12 +27,12 @@ void MetalinkerTest::testQueryEntry() {
SharedHandle<Metalinker> metalinker(new Metalinker());
SharedHandle<MetalinkEntry> entry1(new MetalinkEntry());
entry1->version = "0.5.2";
entry1->language = "en-US";
entry1->os = "Linux-x86";
entry1->languages.push_back("en-US");
entry1->oses.push_back("Linux-x86");
SharedHandle<MetalinkEntry> entry2(new MetalinkEntry());
entry2->version = "0.5.1";
entry2->language = "ja-JP";
entry2->os = "Linux-m68k";
entry2->languages.push_back("ja-JP");
entry2->oses.push_back("Linux-m68k");
metalinker->entries.push_back(entry1);
metalinker->entries.push_back(entry2);
@ -48,8 +48,8 @@ void MetalinkerTest::testQueryEntry() {
metalinker->queryEntry(result, version, language, os);
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
CPPUNIT_ASSERT_EQUAL(std::string("0.5.1"), result.at(0)->version);
CPPUNIT_ASSERT_EQUAL(std::string("ja-JP"), result.at(0)->language);
CPPUNIT_ASSERT_EQUAL(std::string("Linux-m68k"), result.at(0)->os);
CPPUNIT_ASSERT_EQUAL(std::string("ja-JP"), result.at(0)->languages[0]);
CPPUNIT_ASSERT_EQUAL(std::string("Linux-m68k"), result.at(0)->oses[0]);
}
version = "0.6.0";
language = "";
@ -68,8 +68,8 @@ void MetalinkerTest::testQueryEntry() {
metalinker->queryEntry(result, version, language, os);
CPPUNIT_ASSERT_EQUAL((size_t)1, result.size());
CPPUNIT_ASSERT_EQUAL(std::string("0.5.2"), result.at(0)->version);
CPPUNIT_ASSERT_EQUAL(std::string("en-US"), result.at(0)->language);
CPPUNIT_ASSERT_EQUAL(std::string("Linux-x86"), result.at(0)->os);
CPPUNIT_ASSERT_EQUAL(std::string("en-US"), result.at(0)->languages[0]);
CPPUNIT_ASSERT_EQUAL(std::string("Linux-x86"), result.at(0)->oses[0]);
}
}