aria2/test/FeatureConfigTest.cc

81 lines
2.1 KiB
C++
Raw Normal View History

2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
#include "FeatureConfig.h"
#include <cppunit/extensions/HelperMacros.h>
namespace aria2 {
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
class FeatureConfigTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(FeatureConfigTest);
CPPUNIT_TEST(testGetDefaultPort);
CPPUNIT_TEST(testIsSupported);
CPPUNIT_TEST(testGetConfigurationSummary);
CPPUNIT_TEST_SUITE_END();
public:
void testGetDefaultPort();
void testIsSupported();
void testGetConfigurationSummary();
};
CPPUNIT_TEST_SUITE_REGISTRATION(FeatureConfigTest);
void FeatureConfigTest::testGetDefaultPort() {
CPPUNIT_ASSERT_EQUAL((int32_t)80,
FeatureConfig::getInstance()->getDefaultPort("http"));
CPPUNIT_ASSERT_EQUAL((int32_t)443,
FeatureConfig::getInstance()->getDefaultPort("https"));
CPPUNIT_ASSERT_EQUAL((int32_t)21,
FeatureConfig::getInstance()->getDefaultPort("ftp"));
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
}
void FeatureConfigTest::testIsSupported() {
CPPUNIT_ASSERT_EQUAL(true,
FeatureConfig::getInstance()->isSupported("http"));
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#ifdef ENABLE_SSL
CPPUNIT_ASSERT_EQUAL(true,
FeatureConfig::getInstance()->isSupported("https"));
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#else
CPPUNIT_ASSERT_EQUAL(false,
FeatureConfig::getInstance()->isSupported("https"));
#endif // ENABLE_SSL
CPPUNIT_ASSERT_EQUAL(true,
FeatureConfig::getInstance()->isSupported("ftp"));
CPPUNIT_ASSERT_EQUAL(false,
FeatureConfig::getInstance()->isSupported("ftps"));
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
}
void FeatureConfigTest::testGetConfigurationSummary() {
CPPUNIT_ASSERT_EQUAL(std::string("http: yes\n")
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#ifdef ENABLE_SSL
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
+"https: yes\n"
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#else
+"https: no\n"
#endif // ENABLE_SSL
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
+"ftp: yes\n"
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#ifdef ENABLE_BITTORRENT
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
+"bittorrent: yes\n"
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#else
+"bittorrent: no\n"
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_METALINK
+"metalink: yes\n"
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#else
+"metalink: no\n"
#endif // ENABLE_METALINK
#ifdef ENABLE_MESSAGE_DIGEST
2006-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/FeatureConfig.cc (FEATURE_ASYNC_DNS): New definition. (FeatureConfig): Added aysnc DNS entry. To replace CommandUuid with Command* in SocketEntry and NameResolverEntry: * src/DownloadEngine.h (CommandUuids): Removed. (SocketEntry::commandUuid): Removed. (SocketEntry::command): New variable. (SocketEntry::SocketEntry): Updated. (SocketEntry::operator==): Updated. (NameResolverEntry::commandUuid): Removed. (NameResolverEntry::command): New variable. (NameResolverEntry::NameResolverEntry): Updated. (NameResolverEntry::operator==): Updated. (waitData): Changed the argument type. (addSocketForReadCheck): Changed the argument type. (deleteSocketForReadCheck): Changed the argument type. (addSocketForWriteCheck): Changed the argument type. (deleteSocketForWriteCheck): Changed the argument type. (addNameResolverCheck): Changed the argument type. (deleteNameResolverCheck): Changed the argument type. * src/DownloadEngine.cc (FindCommand): Removed. (run): Removed activeUuid. Added activeCommands instead. (AccumulateActiveUuid): Renamed as AccumulateActiveCommand. (AccumulateActiveCommand): New function object. (waitData): Use AccumulateActiveCommand. (addSocketForReadCheck): Use Command instead of CommandUuid. (deleteSocketForReadCheck): Use Command instead of CommandUuid. (addSocketForWriteCheck): Use Command instead of CommandUuid. (deleteSocketForWriteCheck): Use Command instead of CommandUuid. (addNameResolverCheck): Use Command instead of CommandUuid. (deleteNameResolverCheck): Use Command instead of CommandUuid. * src/AbstractCommand.cc (disableReadCheckSocket): Updated according to the changes in DownloadEngine. (setReadCheckSocket): Updated according to the changes in DownloadEngine. (disableWriteCheckSocket): Updated according to the changes in DownloadEngine. (setWriteCheckSocket): Updated according to the changes in DownloadEngine. (setNameResolverCheck): Updated according to the changes in DownloadEngine. (disableNameResolverCheck): Updated according to the changes in DownloadEngine. * src/AbstractCommand.cc (disableReadCheckSocket): Updated according to the changes in DownloadEngine. (setReadCheckSocket): Updated according to the changes in DownloadEngine. (disableWriteCheckSocket): Updated according to the changes in DownloadEngine. (setWriteCheckSocket): Updated according to the changes in DownloadEngine. * release 0.7.1
2006-08-14 15:03:38 +00:00
+"message digest: yes\n"
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> MessageDigestHelper is introduced in order to simplify the use of message digest. Removed repeated code. The message digest algorithm is now specified by string, like "sha1", "md5". * src/messageDigest.{h, cc} * src/MessageDigestHelper.{h, cc}: New class. * src/DefaultPieceStorage.cc * src/DefaultBtContext.{h, cc} (computeFastSet): New function. (setInfoHash): Added for unit testing. (setNumPieces): Added for unit testing. * src/DefaultBtInteractive.cc * src/BtPieceMessage.cc * src/Peer.cc * src/Checksum.h * src/message.h * src/IteratableChecksumValidator.h * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator inside it. * src/SegmentMan.{h, cc} (checkIntegrity): Removed. * src/IteratableChunkChecksumValidator.{h, cc} * src/Util.h (sha1Sum): Removed. (simpleMessageDigest): Removed. (fileChecksum): Removed. (computeFastSet): Removed. * src/ShaVisitor.cc * src/ChunkChecksum.h * src/DownloadCommand.cc Removed messageDigest virtual functions. * src/MultiDiskAdaptor.{h, cc} * src/DiskAdaptor.h * src/ByteArrayDiskWriter.h * src/DiskWriter.h * src/DiskAdaptorWriter.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/AbstractDiskWriter.{h, cc} Fixed comilation error when message digest is disabled. * src/MetalinkEntry.{h, cc} * src/MetalinkRequestInfo.cc Removed srandom and random. * src/SimpleRandomizer.h Added size() virtual function to DiskAdaptor * src/MultiDiskAdaptor.h Fixed the bug that causes that files are not opened correctly in multi-file torrent. * src/TorrentRequestInfo.cc * src/MultiDiskAdaptor.cc Added SHA256 support * src/messageDigest.cc * src/Xml2MetalinkProcessor.cc Show supported message digest algorithms * src/main.cc Updated contact info. * src/main.cc
2007-08-08 14:40:11 +00:00
#else
+"message digest: no\n"
#endif // ENABLE_MESSAGE_DIGEST
#ifdef ENABLE_ASYNC_DNS
+"async dns: yes\n"
#else
+"async dns: no\n"
#endif // ENABLE_ASYNC_DNS
,
FeatureConfig::getInstance()->getConfigurationSummary());
2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/TorrentMan.h: (advertisePiece): Updated doc. (getAdvertisedPieceIndexes): Updated doc. (removeAdvertisedPiece); New function. * src/TorrentMan.cc (FindElapsedHave): New function object. (removeAdvertisedPiece): New function. * src/HaveEraseCommand.h: New class. * src/HaveEraseCommand.cc: New class. * src/FeatureConfig.h: New class. * src/FeatureConfig.cc: New class. * src/Request.h (defaultPorts): Removed. * src/Request.cc (FeatureConfig.h): Included. (Request): Removed the statements related to defaultPorts. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead. A default port number is now retrieved from FeatureConfig. * src/main.cc (HaveEraseCommand.h): Included. (showVersion): Added the output of feature list. (main): Added HaveEraseCommand to command queue in BitTorrent downloading. * src/PeerInteractionCommand.h (chokeCheckPoint): Commented out. (periodicExecPoint): New variable. * src/PeerInteractionCommand.cc (executeInternal): Following methods are now called in at least every 0.5 seconds to reduce CPU usage: detectMessageFlooding(), peerInteraction->checkRequestSlot(), checkHave(), sendKeepAlive(). (checkLongTimePeerChoking): Commented out. * src/BitfieldMan.h (getNthBitIndex): Changed the method signature. (getMissingIndexRandomly): Changed the method signature. * src/BitfieldMan.cc (getNthBitIndex): Rewritten (getMissingIndexRandomly): Rewritten. (hasMissingPiece): Rewritten. (getMissingIndex): Refactored. (getMissingUnusedIndex); Refactored. (getMissingIndex): Refactored.
2006-07-30 12:58:27 +00:00
}
} // namespace aria2