From 9cdcbf32ff69afc4c2c8f220df90aabed62dafde Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 27 Aug 2008 16:04:36 +0000 Subject: [PATCH] 2008-08-28 Tatsuhiro Tsujikawa Added CookieStorage class which is based on RFC2109 and manages cookies more strictly than CookieBox and CookieBoxFactory class. * src/CookieStorage.cc * src/CookieStorage.h * src/Cookie.cc * src/Cookie.h * test/CookieStorageTest.cc * test/CookieTest.cc --- ChangeLog | 11 +++ src/Cookie.cc | 93 ++++++++++++++++++-- src/Cookie.h | 10 ++- src/CookieStorage.cc | 175 ++++++++++++++++++++++++++++++++++++++ src/CookieStorage.h | 95 +++++++++++++++++++++ test/CookieStorageTest.cc | 128 ++++++++++++++++++++++++++++ test/CookieTest.cc | 142 +++++++++++++++++++++++++++++++ test/Makefile.am | 4 +- test/Makefile.in | 13 ++- 9 files changed, 660 insertions(+), 11 deletions(-) create mode 100644 src/CookieStorage.cc create mode 100644 src/CookieStorage.h create mode 100644 test/CookieStorageTest.cc create mode 100644 test/CookieTest.cc diff --git a/ChangeLog b/ChangeLog index a8bf24c3..3ef98417 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-08-28 Tatsuhiro Tsujikawa + + Added CookieStorage class which is based on RFC2109 and manages cookies + more strictly than CookieBox and CookieBoxFactory class. + * src/CookieStorage.cc + * src/CookieStorage.h + * src/Cookie.cc + * src/Cookie.h + * test/CookieStorageTest.cc + * test/CookieTest.cc + 2008-08-27 Tatsuhiro Tsujikawa Fixed the bug that commands are created more than the number of pieces. diff --git a/src/Cookie.cc b/src/Cookie.cc index dcd95a9f..46693934 100644 --- a/src/Cookie.cc +++ b/src/Cookie.cc @@ -35,6 +35,8 @@ #include "Cookie.h" #include "Util.h" #include "A2STR.h" +#include "TimeA2.h" +#include namespace aria2 { @@ -48,7 +50,7 @@ Cookie::Cookie(const std::string& name, value(value), expires(expires), path(path), - domain(domain), + domain(Util::toLower(domain)), secure(secure), onetime(false) {} @@ -60,7 +62,7 @@ Cookie::Cookie(const std::string& name, name(name), value(value), path(path), - domain(domain), + domain(Util::toLower(domain)), secure(secure), onetime(true) {} @@ -85,11 +87,40 @@ bool Cookie::good() const return !name.empty(); } -bool Cookie::match(const std::string& host, const std::string& dir, time_t date, bool secure) const +static bool pathInclude(const std::string& requestPath, const std::string& path) { + if(requestPath == path) { + return true; + } + if(Util::startsWith(requestPath, path)) { + if(*path.rbegin() != '/' && requestPath[path.size()] != '/') { + return false; + } + } else if(*path.rbegin() != '/' || *requestPath.rbegin() == '/' || + !Util::startsWith(requestPath+"/", path)) { + return false; + } + return true; +} + +static bool domainMatch(const std::string& requestHost, + const std::string& domain) +{ + if(*domain.begin() == '.') { + return Util::endsWith("."+requestHost, domain); + } else { + return requestHost == domain; + } +} + +bool Cookie::match(const std::string& requestHost, + const std::string& requestPath, + time_t date, bool secure) const +{ + std::string lowerRequestHost = Util::toLower(requestHost); if((secure || (!this->secure && !secure)) && - Util::endsWith("."+host, this->domain) && - Util::startsWith(dir, this->path) && + domainMatch(lowerRequestHost, this->domain) && + pathInclude(requestPath, path) && (this->onetime || (date < this->expires))) { return true; } else { @@ -97,4 +128,56 @@ bool Cookie::match(const std::string& host, const std::string& dir, time_t date, } } +bool Cookie::validate(const std::string& requestHost, + const std::string& requestPath) const +{ + std::string lowerRequestHost = Util::toLower(requestHost); + if(lowerRequestHost != domain) { + // domain must start with '.' + if(*domain.begin() != '.') { + return false; + } + // domain must not end with '.' + if(*domain.rbegin() == '.') { + return false; + } + // domain must include at least one embeded '.' + if(domain.size() < 4 || domain.find(".", 1) == std::string::npos) { + return false; + } + if(!Util::endsWith(lowerRequestHost, domain)) { + return false; + } + // From RFC2109 + // * The request-host is a FQDN (not IP address) and has the form HD, + // where D is the value of the Domain attribute, and H is a string + // that contains one or more dots. + if(std::count(lowerRequestHost.begin(), + lowerRequestHost.begin()+ + (lowerRequestHost.size()-domain.size()), '.') + > 0) { + return false; + } + } + if(requestPath != path) { + // From RFC2109 + // * The value for the Path attribute is not a prefix of the request- + // URI. + if(!pathInclude(requestPath, path)) { + return false; + } + } + return !name.empty(); +} + +bool Cookie::operator==(const Cookie& cookie) const +{ + return domain == cookie.domain && path == cookie.path && name == cookie.name; +} + +bool Cookie::isExpired() const +{ + return !onetime && Time().getTime() >= expires; +} + } // namespace aria2 diff --git a/src/Cookie.h b/src/Cookie.h index a4529749..eeafb1f8 100644 --- a/src/Cookie.h +++ b/src/Cookie.h @@ -75,7 +75,15 @@ public: bool good() const; - bool match(const std::string& host, const std::string& dir, time_t date, bool secure) const; + bool match(const std::string& requestHost, const std::string& requestPath, + time_t date, bool secure) const; + + bool validate(const std::string& requestHost, + const std::string& requestPath) const; + + bool operator==(const Cookie& cookie) const; + + bool isExpired() const; }; typedef std::deque Cookies; diff --git a/src/CookieStorage.cc b/src/CookieStorage.cc new file mode 100644 index 00000000..6f2ccaf5 --- /dev/null +++ b/src/CookieStorage.cc @@ -0,0 +1,175 @@ +/* */ +#include "CookieStorage.h" +#include "Util.h" +#include "LogFactory.h" +#include "Logger.h" +#include "RecoverableException.h" +#include "StringFormat.h" +#include "NsCookieParser.h" +#ifdef HAVE_SQLITE3 +# include "Sqlite3MozCookieParser.h" +#endif // HAVE_SQLITE3 +#include +#include + +namespace aria2 { + +CookieStorage::CookieStorage():_logger(LogFactory::getInstance()) {} + +CookieStorage::~CookieStorage() {} + +bool CookieStorage::store(const Cookie& cookie) +{ + if(!cookie.good()) { + return false; + } + std::deque::iterator i = std::find(_cookies.begin(), _cookies.end(), + cookie); + if(i == _cookies.end()) { + if(cookie.isExpired()) { + return false; + } else { + _cookies.push_back(cookie); + return true; + } + } else if(cookie.isExpired()) { + _cookies.erase(i); + return false; + } else { + *i = cookie; + return true; + } +} + +void CookieStorage::storeCookies(const std::deque& cookies) +{ + for(std::deque::const_iterator i = cookies.begin(); + i != cookies.end(); ++i) { + store(*i); + } +} + +bool CookieStorage::parseAndStore(const std::string& setCookieString, + const std::string& requestHost, + const std::string& requestPath) +{ + if(Util::isNumbersAndDotsNotation(requestHost)) { + return false; + } + Cookie cookie = _parser.parse(setCookieString, requestHost, requestPath); + if(cookie.validate(requestHost, requestPath)) { + return store(cookie); + } else { + return false; + } +} + +class CriteriaMatch:public std::unary_function { +private: + std::string _requestHost; + std::string _requestPath; + time_t _date; + bool _secure; +public: + CriteriaMatch(const std::string& requestHost, const std::string& requestPath, + time_t date, bool secure): + _requestHost(requestHost), + _requestPath(requestPath), + _date(date), + _secure(secure) {} + + bool operator()(const Cookie& cookie) const + { + return cookie.match(_requestHost, _requestPath, _date, _secure); + } +}; + +class OrderByPathDesc:public std::binary_function { +public: + bool operator()(const Cookie& lhs, const Cookie& rhs) const + { + return lhs.path > rhs.path; + } +}; + +std::deque CookieStorage::criteriaFind(const std::string& requestHost, + const std::string& requestPath, + time_t date, bool secure) const +{ + std::deque res; + std::remove_copy_if(_cookies.begin(), _cookies.end(), std::back_inserter(res), + std::not1(CriteriaMatch(requestHost, requestPath, date, secure))); + std::sort(res.begin(), res.end(), OrderByPathDesc()); + return res; +} + +size_t CookieStorage::size() const +{ + return _cookies.size(); +} + +void CookieStorage::load(const std::string& filename) +{ + char header[16]; // "SQLite format 3" plus \0 + { + std::ifstream s(filename.c_str()); + s.get(header, sizeof(header)); + if(s.bad()) { + throw RecoverableException + (StringFormat("Failed to read header of cookie file %s", + filename.c_str()).str()); + } + } + try { + if(std::string(header) == "SQLite format 3") { +#ifdef HAVE_SQLITE3 + storeCookies(Sqlite3MozCookieParser().parse(filename)); +#else // !HAVE_SQLITE3 + throw RecoverableException + ("Cannot read SQLite3 database because SQLite3 support is disabled by" + " configuration."); +#endif // !HAVE_SQLITE3 + } else { + storeCookies(NsCookieParser().parse(filename)); + } + } catch(RecoverableException& e) { + throw RecoverableException + (StringFormat("Failed to load cookies from %s", filename.c_str()).str(), + e); + } +} + +} // namespace aria2 diff --git a/src/CookieStorage.h b/src/CookieStorage.h new file mode 100644 index 00000000..d8ea6149 --- /dev/null +++ b/src/CookieStorage.h @@ -0,0 +1,95 @@ +/* */ +#ifndef _D_COOKIE_STORAGE_H_ +#define _D_COOKIE_STORAGE_H_ + +#include "common.h" +#include "a2time.h" +#include "Cookie.h" +#include "CookieParser.h" +#include +#include + +namespace aria2 { + +class Logger; + +class CookieStorage { +private: + std::deque _cookies; + + CookieParser _parser; + + Logger* _logger; + + void storeCookies(const std::deque& cookies); +public: + CookieStorage(); + + ~CookieStorage(); + + // Returns true if cookie is stored or updated existing cookie. + // Returns false if cookie is expired. + bool store(const Cookie& cookie); + + // Returns true if cookie is stored or updated existing cookie. + // Otherwise, returns false. + bool parseAndStore(const std::string& setCookieString, + const std::string& requestHost, + const std::string& requestPath); + + std::deque criteriaFind(const std::string& requestHost, + const std::string& requestPath, + time_t date, bool secure) const; + + void load(const std::string& filename); + + size_t size() const; + + std::deque::const_iterator begin() const + { + return _cookies.begin(); + } + + std::deque::const_iterator end() const + { + return _cookies.end(); + } + +}; + +} // namespace aria2 + +#endif // _D_COOKIE_STORAGE_H_ diff --git a/test/CookieStorageTest.cc b/test/CookieStorageTest.cc new file mode 100644 index 00000000..9f1a156b --- /dev/null +++ b/test/CookieStorageTest.cc @@ -0,0 +1,128 @@ +#include "CookieStorage.h" +#include "Exception.h" +#include "Util.h" +#include "TimeA2.h" +#include "CookieParser.h" +#include +#include +#include + +namespace aria2 { + +class CookieStorageTest:public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE(CookieStorageTest); + CPPUNIT_TEST(testStore); + CPPUNIT_TEST(testParseAndStore); + CPPUNIT_TEST(testCriteriaFind); + CPPUNIT_TEST_SUITE_END(); +public: + void setUp() {} + + void tearDown() {} + + void testStore(); + void testParseAndStore(); + void testCriteriaFind(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(CookieStorageTest); + +void CookieStorageTest::testStore() +{ + CookieStorage st; + Cookie goodCookie("k", "v", "/", "localhost", false); + CPPUNIT_ASSERT(st.store(goodCookie)); + CPPUNIT_ASSERT_EQUAL((size_t)1, st.size()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), goodCookie) != st.end()); + + Cookie anotherCookie("k", "v", "/", "mirror", true); + CPPUNIT_ASSERT(st.store(anotherCookie)); + CPPUNIT_ASSERT_EQUAL((size_t)2, st.size()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), anotherCookie) != st.end()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), goodCookie) != st.end()); + + Cookie updateGoodCookie("k", "v2", "/", "localhost", false); + CPPUNIT_ASSERT(st.store(goodCookie)); + CPPUNIT_ASSERT_EQUAL((size_t)2, st.size()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), updateGoodCookie) != st.end()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), anotherCookie) != st.end()); + + Cookie expireGoodCookie("k", "v3", 0, "/", "localhost", false); + CPPUNIT_ASSERT(!st.store(expireGoodCookie)); + CPPUNIT_ASSERT_EQUAL((size_t)1, st.size()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), anotherCookie) != st.end()); + + Cookie badCookie("", "", "/", "localhost", false); + CPPUNIT_ASSERT(!st.store(badCookie)); + CPPUNIT_ASSERT_EQUAL((size_t)1, st.size()); + CPPUNIT_ASSERT(std::find(st.begin(), st.end(), anotherCookie) != st.end()); +} + +void CookieStorageTest::testParseAndStore() +{ + CookieStorage st; + + std::string localhostCookieStr = "k=v;" + " expires=Fri, 2038-01-01 00:00:00 GMT; path=/; domain=localhost;"; + + CPPUNIT_ASSERT(st.parseAndStore(localhostCookieStr, + "localhost", "/downloads")); + CPPUNIT_ASSERT(!st.parseAndStore(localhostCookieStr, + "mirror", "/downloads")); + + CPPUNIT_ASSERT(!st.parseAndStore(localhostCookieStr, + "127.0.0.1", "/downloads")); +} + +void CookieStorageTest::testCriteriaFind() +{ + CookieStorage st; + + Cookie alpha("alpha", "ALPHA", "/", ".aria2.org", false); + Cookie bravo("bravo", "BRAVO", Time().getTime()+60, "/foo", ".aria2.org", + false); + Cookie charlie("charlie", "CHARLIE", "/", ".aria2.org", true); + Cookie delta("delta", "DELTA", "/foo/bar", ".aria2.org", false); + Cookie echo("echo", "ECHO", "/", "www.aria2.org", false); + Cookie foxtrot("foxtrot", "FOXTROT", "/", ".sf.net", false); + CPPUNIT_ASSERT(st.store(alpha)); + CPPUNIT_ASSERT(st.store(bravo)); + CPPUNIT_ASSERT(st.store(charlie)); + CPPUNIT_ASSERT(st.store(delta)); + CPPUNIT_ASSERT(st.store(echo)); + CPPUNIT_ASSERT(st.store(foxtrot)); + + std::deque aria2Slash = st.criteriaFind("www.aria2.org", "/", + 0, false); + CPPUNIT_ASSERT_EQUAL((size_t)2, aria2Slash.size()); + CPPUNIT_ASSERT(std::find(aria2Slash.begin(), aria2Slash.end(), alpha) + != aria2Slash.end()); + CPPUNIT_ASSERT(std::find(aria2Slash.begin(), aria2Slash.end(), echo) + != aria2Slash.end()); + + std::deque aria2SlashFoo = st.criteriaFind("www.aria2.org", "/foo", + 0, false); + CPPUNIT_ASSERT_EQUAL((size_t)3, aria2SlashFoo.size()); + CPPUNIT_ASSERT_EQUAL(std::string("bravo"), aria2SlashFoo[0].name); + CPPUNIT_ASSERT(std::find(aria2SlashFoo.begin(), aria2SlashFoo.end(), alpha) + != aria2SlashFoo.end()); + CPPUNIT_ASSERT(std::find(aria2SlashFoo.begin(), aria2SlashFoo.end(), echo) + != aria2SlashFoo.end()); + + std::deque aria2Expires = st.criteriaFind("www.aria2.org", "/foo", + Time().getTime()+120, + false); + CPPUNIT_ASSERT_EQUAL((size_t)2, aria2Expires.size()); + CPPUNIT_ASSERT(std::find(aria2Expires.begin(), aria2Expires.end(), alpha) + != aria2Expires.end()); + CPPUNIT_ASSERT(std::find(aria2Expires.begin(), aria2Expires.end(), echo) + != aria2Expires.end()); + + std::deque dlAria2 = st.criteriaFind("dl.aria2.org", "/", 0, false); + CPPUNIT_ASSERT_EQUAL((size_t)1, dlAria2.size()); + CPPUNIT_ASSERT_EQUAL(std::string("alpha"), dlAria2[0].name); +} + +} // namespace aria2 diff --git a/test/CookieTest.cc b/test/CookieTest.cc new file mode 100644 index 00000000..0221ae05 --- /dev/null +++ b/test/CookieTest.cc @@ -0,0 +1,142 @@ +#include "Cookie.h" +#include "Exception.h" +#include "Util.h" +#include "TimeA2.h" +#include +#include + +namespace aria2 { + +class CookieTest:public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE(CookieTest); + CPPUNIT_TEST(testValidate); + CPPUNIT_TEST(testOperatorEqual); + CPPUNIT_TEST(testMatch); + CPPUNIT_TEST(testIsExpired); + CPPUNIT_TEST_SUITE_END(); +public: + void setUp() {} + + void tearDown() {} + + void testValidate(); + void testOperatorEqual(); + void testMatch(); + void testIsExpired(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(CookieTest); + +void CookieTest::testValidate() +{ + { + Cookie defaultDomainPath("k", "v", "/", "localhost", false); + CPPUNIT_ASSERT(defaultDomainPath.validate("localhost", "/")); + } + { + Cookie domainStartsWithDot("k", "v", "/", "aria2.org", false); + CPPUNIT_ASSERT(!domainStartsWithDot.validate("www.aria2.org", "/")); + Cookie success("k", "v", "/", ".aria2.org", false); + CPPUNIT_ASSERT(success.validate("www.aria2.org", "/")); + } + { + Cookie domainWithoutEmbeddedDot("k", "v", "/", ".org", false); + CPPUNIT_ASSERT(!domainWithoutEmbeddedDot.validate("aria2.org", "/")); + } + { + Cookie domainEndsWithDot("k", "v", "/", ".aria2.org.", false); + CPPUNIT_ASSERT(!domainEndsWithDot.validate("www.aria2.org", "/")); + } + { + Cookie domainHD("k", "v", "/", ".aria2.org", false); + CPPUNIT_ASSERT(!domainHD.validate("aria2.www.aria2.org", "/")); + } + { + Cookie pathNotStartsWith("k", "v", "/downloads", "localhost", false); + CPPUNIT_ASSERT(!pathNotStartsWith.validate("localhost", "/examples")); + } + { + Cookie pathStartsWith("k", "v", "/downloads", "localhost", false); + CPPUNIT_ASSERT(pathStartsWith.validate("localhost", "/downloads/latest/")); + } + { + Cookie pathSlash("k", "v", "/downloads", "localhost", false); + CPPUNIT_ASSERT(pathSlash.validate("localhost", "/downloads/")); + } + { + Cookie pathSlash("k", "v", "/downloads/", "localhost", false); + CPPUNIT_ASSERT(pathSlash.validate("localhost", "/downloads")); + } + { + Cookie pathNotMatch("k", "v", "/downloads", "localhost", false); + CPPUNIT_ASSERT(!pathNotMatch.validate("localhost", "/downloadss")); + } + { + Cookie pathNotMatch("k", "v", "/downloads/", "localhost", false); + CPPUNIT_ASSERT(!pathNotMatch.validate("localhost", "/downloadss")); + } + { + Cookie pathNotMatch("k", "v", "/downloads", "localhost", false); + CPPUNIT_ASSERT(!pathNotMatch.validate("localhost", "/downloadss/")); + } + { + Cookie nameEmpty("", "v", "/", "localhost", false); + CPPUNIT_ASSERT(!nameEmpty.validate("localhost", "/")); + } +} + +void CookieTest::testOperatorEqual() +{ + Cookie a("k", "v", "/", "localhost", false); + Cookie b("k", "v", "/", "LOCALHOST", true); + Cookie wrongPath("k", "v", "/a", "localhost", false); + Cookie wrongDomain("k", "v", "/", "mydomain", false); + Cookie wrongName("h", "v", "/a", "localhost", false); + Cookie caseSensitiveName("K", "v", "/a", "localhost", false); + CPPUNIT_ASSERT(a == b); + CPPUNIT_ASSERT(!(a == wrongPath)); + CPPUNIT_ASSERT(!(a == wrongDomain)); + CPPUNIT_ASSERT(!(a == wrongName)); + CPPUNIT_ASSERT(!(a == caseSensitiveName)); +} + +void CookieTest::testMatch() +{ + Cookie c("k", "v", "/downloads", ".aria2.org", false); + Cookie c2("k", "v", "/downloads/", ".aria2.org", false); + CPPUNIT_ASSERT(c.match("www.aria2.org", "/downloads", 0, false)); + CPPUNIT_ASSERT(c.match("www.aria2.org", "/downloads/", 0, false)); + CPPUNIT_ASSERT(c2.match("www.aria2.org", "/downloads", 0, false)); + CPPUNIT_ASSERT(c.match("WWW.ARIA2.ORG", "/downloads", 0, false)); + CPPUNIT_ASSERT(!c.match("www.aria.org", "/downloads", 0, false)); + CPPUNIT_ASSERT(!c.match("www.aria2.org", "/examples", 0, false)); + CPPUNIT_ASSERT(c.match("www.aria2.org", "/downloads", 0, true)); + CPPUNIT_ASSERT(c.match("www.aria2.org", "/downloads/latest", 0, false)); + CPPUNIT_ASSERT(!c.match("www.aria2.org", "/downloadss/latest", 0, false)); + CPPUNIT_ASSERT(!c.match("www.aria2.org", "/DOWNLOADS", 0, false)); + + Cookie secureCookie("k", "v", "/", "secure.aria2.org", true); + CPPUNIT_ASSERT(secureCookie.match("secure.aria2.org", "/", 0, true)); + CPPUNIT_ASSERT(!secureCookie.match("secure.aria2.org", "/", 0, false)); + CPPUNIT_ASSERT(!secureCookie.match("ssecure.aria2.org", "/", 0, true)); + CPPUNIT_ASSERT(!secureCookie.match("www.secure.aria2.org", "/", 0, true)); + + Cookie expireTest("k", "v", 1000, "/", ".aria2.org", false); + CPPUNIT_ASSERT(expireTest.match("www.aria2.org", "/", 999, false)); + CPPUNIT_ASSERT(!expireTest.match("www.aria2.org", "/", 1000, false)); + CPPUNIT_ASSERT(!expireTest.match("www.aria2.org", "/", 1001, false)); +} + +void CookieTest::testIsExpired() +{ + Cookie expiredCookie("k", "v", 1000, "/", "localhost", false); + CPPUNIT_ASSERT(expiredCookie.isExpired()); + Cookie validCookie("k", "v", Time().getTime()+60, "/", "localhost", false); + CPPUNIT_ASSERT(!validCookie.isExpired()); + Cookie sessionCookie("k", "v", "/", "localhost", false); + CPPUNIT_ASSERT(!sessionCookie.isExpired()); +} + +} // namespace aria2 diff --git a/test/Makefile.am b/test/Makefile.am index c68c7a64..2d6b528f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -60,7 +60,9 @@ aria2c_SOURCES = AllTest.cc\ InOrderURISelectorTest.cc\ ServerStatTest.cc\ NsCookieParserTest.cc\ - DirectDiskAdaptorTest.cc + DirectDiskAdaptorTest.cc\ + CookieTest.cc\ + CookieStorageTest.cc if HAVE_LIBZ aria2c_SOURCES += GZipDecoderTest.cc diff --git a/test/Makefile.in b/test/Makefile.in index d85eb075..279b31b2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -193,8 +193,9 @@ am__aria2c_SOURCES_DIST = AllTest.cc TestUtil.cc TestUtil.h \ SignatureTest.cc ServerStatManTest.cc \ ServerStatURISelectorTest.cc InOrderURISelectorTest.cc \ ServerStatTest.cc NsCookieParserTest.cc \ - DirectDiskAdaptorTest.cc GZipDecoderTest.cc \ - Sqlite3MozCookieParserTest.cc MessageDigestHelperTest.cc \ + DirectDiskAdaptorTest.cc CookieTest.cc CookieStorageTest.cc \ + GZipDecoderTest.cc Sqlite3MozCookieParserTest.cc \ + MessageDigestHelperTest.cc \ IteratableChunkChecksumValidatorTest.cc \ IteratableChecksumValidatorTest.cc BtAllowedFastMessageTest.cc \ BtBitfieldMessageTest.cc BtCancelMessageTest.cc \ @@ -365,6 +366,7 @@ am_aria2c_OBJECTS = AllTest.$(OBJEXT) TestUtil.$(OBJEXT) \ ServerStatURISelectorTest.$(OBJEXT) \ InOrderURISelectorTest.$(OBJEXT) ServerStatTest.$(OBJEXT) \ NsCookieParserTest.$(OBJEXT) DirectDiskAdaptorTest.$(OBJEXT) \ + CookieTest.$(OBJEXT) CookieStorageTest.$(OBJEXT) \ $(am__objects_1) $(am__objects_2) $(am__objects_3) \ $(am__objects_4) $(am__objects_5) aria2c_OBJECTS = $(am_aria2c_OBJECTS) @@ -587,8 +589,9 @@ aria2c_SOURCES = AllTest.cc TestUtil.cc TestUtil.h SocketCoreTest.cc \ SignatureTest.cc ServerStatManTest.cc \ ServerStatURISelectorTest.cc InOrderURISelectorTest.cc \ ServerStatTest.cc NsCookieParserTest.cc \ - DirectDiskAdaptorTest.cc $(am__append_1) $(am__append_2) \ - $(am__append_3) $(am__append_4) $(am__append_5) + DirectDiskAdaptorTest.cc CookieTest.cc CookieStorageTest.cc \ + $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) $(am__append_5) #aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -I../lib -Wall -D_FILE_OFFSET_BITS=64 #aria2c_LDFLAGS = ${CPPUNIT_LIBS} @@ -710,6 +713,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxFactoryTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieParserTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieStorageTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHKeyExchangeTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHTAnnouncePeerMessageTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHTAnnouncePeerReplyMessageTest.Po@am__quote@