From 3e4b74841280946ae024f5fbc48bdabacc250325 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 22 Jul 2008 16:05:02 +0000 Subject: [PATCH] 2008-07-23 Tatsuhiro Tsujikawa Added GZip to `Enabled Features' list. * src/FeatureConfig.cc * src/FeatureConfig.h * test/FeatureConfigTest.cc --- ChangeLog | 7 +++++++ src/FeatureConfig.cc | 30 +++++++++++++++++++----------- src/FeatureConfig.h | 1 + test/FeatureConfigTest.cc | 4 ++++ 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index af9e9d28..364215b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-23 Tatsuhiro Tsujikawa + + Added GZip to `Enabled Features' list. + * src/FeatureConfig.cc + * src/FeatureConfig.h + * test/FeatureConfigTest.cc + 2008-07-20 Tatsuhiro Tsujikawa Now SegmentMan::findSlowerSegmentEntry() picks up the segment for which diff --git a/src/FeatureConfig.cc b/src/FeatureConfig.cc index 06b37c09..62320178 100644 --- a/src/FeatureConfig.cc +++ b/src/FeatureConfig.cc @@ -47,36 +47,43 @@ const std::string FeatureConfig::FEATURE_BITTORRENT("BitTorrent"); const std::string FeatureConfig::FEATURE_METALINK("Metalink"); const std::string FeatureConfig::FEATURE_MESSAGE_DIGEST("Message Digest"); const std::string FeatureConfig::FEATURE_ASYNC_DNS("Async DNS"); +const std::string FeatureConfig::FEATURE_GZIP("GZip"); #ifdef ENABLE_SSL # define HTTPS_ENABLED true -#else +#else // !ENABLE_SSL # define HTTPS_ENABLED false -#endif // ENABLE_SSL +#endif // !ENABLE_SSL #ifdef ENABLE_BITTORRENT # define BITTORRENT_ENABLED true -#else +#else // !ENABLE_BITTORRENT # define BITTORRENT_ENABLED false -#endif // ENABLE_BITTORRENT +#endif // !ENABLE_BITTORRENT #ifdef ENABLE_METALINK # define METALINK_ENABLED true -#else +#else // !ENABLE_METALINK # define METALINK_ENABLED false -#endif // ENABLE_METALINK +#endif // !ENABLE_METALINK #ifdef ENABLE_MESSAGE_DIGEST # define MESSAGE_DIGEST_ENABLED true -#else +#else // !ENABLE_MESSAGE_DIGEST # define MESSAGE_DIGEST_ENABLED false -#endif // ENABLE_MESSAGE_DIGEST +#endif // !ENABLE_MESSAGE_DIGEST #ifdef ENABLE_ASYNC_DNS # define ASYNC_DNS_ENABLED true -#else +#else // !ENABLE_ASYNC_DNS # define ASYNC_DNS_ENABLED false -#endif // ENABLE_ASYNC_DNS +#endif // !ENABLE_ASYNC_DNS + +#ifdef HAVE_LIBZ +# define GZIP_ENABLED true +#else // !HAVE_LIBZ +# define GZIP_ENABLED false +#endif // !HAVE_LIBZ FeatureConfig::FeatureConfig() { _defaultPorts.insert(PortMap::value_type(Request::PROTO_HTTP, 80)); @@ -88,7 +95,8 @@ FeatureConfig::FeatureConfig() { FeatureMap::value_type(FEATURE_BITTORRENT, BITTORRENT_ENABLED), FeatureMap::value_type(FEATURE_METALINK, METALINK_ENABLED), FeatureMap::value_type(FEATURE_MESSAGE_DIGEST, MESSAGE_DIGEST_ENABLED), - FeatureMap::value_type(FEATURE_ASYNC_DNS, ASYNC_DNS_ENABLED) + FeatureMap::value_type(FEATURE_ASYNC_DNS, ASYNC_DNS_ENABLED), + FeatureMap::value_type(FEATURE_GZIP, GZIP_ENABLED), }; _features.insert(&featureArray[0], &featureArray[arrayLength(featureArray)]); diff --git a/src/FeatureConfig.h b/src/FeatureConfig.h index 60ff4c0d..9c69c3b5 100644 --- a/src/FeatureConfig.h +++ b/src/FeatureConfig.h @@ -67,6 +67,7 @@ public: static const std::string FEATURE_METALINK; static const std::string FEATURE_MESSAGE_DIGEST; static const std::string FEATURE_ASYNC_DNS; + static const std::string FEATURE_GZIP; }; } // namespace aria2 diff --git a/test/FeatureConfigTest.cc b/test/FeatureConfigTest.cc index 86f8b9e8..2909f6f5 100644 --- a/test/FeatureConfigTest.cc +++ b/test/FeatureConfigTest.cc @@ -58,6 +58,10 @@ void FeatureConfigTest::testFeatureSummary() { "BitTorrent", #endif // ENABLE_BITTORRENT +#ifdef HAVE_LIBZ + "GZip", +#endif // HAVE_LIBZ + #ifdef ENABLE_SSL "HTTPS", #endif // ENABLE_SSL