Tatsuhiro Tsujikawa
ca4940622c
2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Changed naming standards for class member variable: now it looks
like var_ instead of _var.
2010-06-21 13:51:56 +00:00
Tatsuhiro Tsujikawa
f02e08629e
2010-04-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Use global::wallclock
* src/DHTBucket.cc
* src/DHTMessageTrackerEntry.cc
* src/DHTMessageTrackerEntry.h
* src/DefaultBtInteractive.cc
* src/Peer.cc
* src/PeerAbstractCommand.cc
* src/PeerStat.h
* src/RequestSlot.h
* src/TimeBasedCommand.cc
2010-04-11 08:57:16 +00:00
Tatsuhiro Tsujikawa
8d09b069e2
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Added Time global::wallclock to cache "current time" to reduce the
call gettimeofday(). Global variables are now in namespace global.
* src/AbstractCommand.cc
* src/ActivePeerConnectionCommand.cc
* src/AdaptiveURISelector.cc
* src/BtLeecherStateChoke.cc
* src/BtLeecherStateChoke.h
* src/BtSeederStateChoke.cc
* src/BtSeederStateChoke.h
* src/BtStopDownloadCommand.cc
* src/ConsoleStatCalc.cc
* src/DHTBucket.cc
* src/DHTGetPeersCommand.cc
* src/DHTMessageTrackerEntry.cc
* src/DHTNode.cc
* src/DHTPeerAnnounceEntry.cc
* src/DHTPeerAnnounceStorage.cc
* src/DHTSetup.cc
* src/DefaultBtAnnounce.cc
* src/DefaultBtInteractive.cc
* src/DefaultBtMessageDispatcher.cc
* src/DefaultPeerStorage.cc
* src/DefaultPieceStorage.cc
* src/DownloadCommand.cc
* src/DownloadEngine.cc
* src/FileEntry.cc
* src/HttpServerBodyCommand.cc
* src/HttpServerCommand.cc
* src/HttpServerResponseCommand.cc
* src/LpdMessageDispatcher.cc
* src/MultiUrlRequestInfo.cc
* src/Peer.cc
* src/Peer.h
* src/PeerAbstractCommand.cc
* src/PeerStat.h
* src/RequestSlot.cc
* src/RequestSlot.h
* src/SegmentMan.cc
* src/ServerStatMan.cc
* src/SleepCommand.cc
* src/SpeedCalc.cc
* src/SpeedCalc.h
* src/TimeA2.cc
* src/TimeA2.h
* src/TimeBasedCommand.cc
* src/TimeSeedCriteria.h
* src/UTMetadataRequestTracker.h
* src/UTPexExtensionMessage.cc
* src/wallclock.h
2010-03-06 08:29:53 +00:00
Tatsuhiro Tsujikawa
72e475dfde
2010-03-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Avoid to calculate end() iterator in each loop. std::deque is
particularly slow. Make sure that recalculate end iterator if
element is erased during loop.
2010-02-28 16:04:52 +00:00
Tatsuhiro Tsujikawa
c342bde962
2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Use vector instead of deque for containers which is used for
mostly read-only purpose.
2010-02-28 12:30:11 +00:00
Tatsuhiro Tsujikawa
e227e53d7b
2010-02-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Wrapped logger->debug(...) with if(logger->debug()) { ... }
* src/AbstractCommand.cc
* src/AdaptiveURISelector.cc
* src/BtPieceMessage.cc
* src/BtPortMessage.cc
* src/CreateRequestCommand.cc
* src/DHTAbstractNodeLookupTask.cc
* src/DHTBucket.cc
* src/DHTGetPeersCommand.cc
* src/DHTMessageDispatcherImpl.cc
* src/DHTMessageFactoryImpl.cc
* src/DHTMessageTracker.cc
* src/DHTPeerAnnounceStorage.cc
* src/DHTRoutingTable.cc
* src/DHTSetup.cc
* src/DefaultBtAnnounce.cc
* src/DefaultBtInteractive.cc
* src/DefaultBtMessageDispatcher.cc
* src/DefaultBtMessageReceiver.cc
* src/DefaultBtProgressInfoFile.cc
* src/DefaultBtRequestFactory.cc
* src/DefaultPeerStorage.cc
* src/DefaultPieceStorage.cc
* src/DownloadCommand.cc
* src/DownloadEngine.cc
* src/EpollEventPoll.cc
* src/FileAllocationCommand.cc
* src/FileEntry.cc
* src/FtpNegotiationCommand.cc
* src/HandshakeExtensionMessage.cc
* src/HttpListenCommand.cc
* src/HttpServer.cc
* src/HttpSkipResponseCommand.cc
* src/IteratableChunkChecksumValidator.cc
* src/Logger.h
* src/MSEHandshake.cc
* src/MetalinkPostDownloadHandler.cc
* src/MultiDiskAdaptor.cc
* src/PeerAbstractCommand.cc
* src/PeerConnection.cc
* src/PeerListenCommand.cc
* src/PeerReceiveHandshakeCommand.cc
* src/RequestGroup.cc
* src/RequestGroupMan.cc
* src/SegmentMan.cc
* src/SelectEventPoll.cc
* src/ServerStat.cc
* src/SimpleBtMessage.cc
* src/SocketCore.cc
* src/TrackerWatcherCommand.cc
* src/UTMetadataDataExtensionMessage.cc
* src/UTMetadataRequestFactory.cc
* src/UTMetadataRequestTracker.cc
* src/XmlRpcMethod.cc
2010-02-09 12:20:20 +00:00
Tatsuhiro Tsujikawa
87b18019b4
2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Moved generateRandomKey() from bittorrent_helper to util.
* src/DHTBucket.cc
* src/DHTNode.cc
* src/bittorrent_helper.cc
* src/bittorrent_helper.h
* src/util.cc
* src/util.h
2010-01-17 10:05:53 +00:00
Tatsuhiro Tsujikawa
4db349c1f3
2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Untabify. Fixed one line in copyright which is longer than 80
columns.
* src
* test
2010-01-05 16:01:46 +00:00
Tatsuhiro Tsujikawa
e976b23728
2009-10-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Renamed Util.{cc,h} as util.{cc,h}
* src/Util.cc
* src/Util.h
* src/util.cc
* src/util.h
2009-10-22 15:35:33 +00:00
Tatsuhiro Tsujikawa
c6035b2e24
2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Moved static functions in Util class to namespace util.
* src
* test
2009-10-22 15:09:00 +00:00
Tatsuhiro Tsujikawa
3349fe0811
2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Moved generateRandomData to Util.cc Moved flipBit to bitfield.cc.
Moved generateRandomKey to bittorrent_helper.cc.
* src/DHTBucket.cc
* src/DHTGetPeersMessage.cc
* src/DHTGetPeersReplyMessage.cc
* src/DHTMessage.cc
* src/DHTNode.cc
* src/DHTTokenTracker.cc
* src/DHTUtil.cc: Removed.
* src/DHTUtil.h: Removed.
* src/Makefile.am
* src/Util.cc
* src/Util.h
* src/bitfield.h
* src/bittorrent_helper.cc
* src/bittorrent_helper.h
* test/ARC4Test.cc
* test/BNodeTest.cc
* test/DHTAnnouncePeerMessageTest.cc
* test/DHTAnnouncePeerReplyMessageTest.cc
* test/DHTFindNodeMessageTest.cc
* test/DHTFindNodeReplyMessageTest.cc
* test/DHTGetPeersMessageTest.cc
* test/DHTGetPeersReplyMessageTest.cc
* test/DHTPingMessageTest.cc
* test/DHTPingReplyMessageTest.cc
* test/DHTTokenTrackerTest.cc
* test/DHTUtilTest.cc: Removed.
* test/Makefile.am
* test/UtilTest.cc
2009-10-22 14:43:42 +00:00
Tatsuhiro Tsujikawa
8b6da1ee36
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Implemented getter methods in header files to give them more
chance of optimization.
Return const reference for SharadHandle if possible.
* src/AbstractAuthResolver.cc
* src/AbstractAuthResolver.h
* src/AbstractBtMessage.cc
* src/AbstractBtMessage.h
* src/AbstractSingleDiskAdaptor.cc
* src/AbstractSingleDiskAdaptor.h
* src/AsyncNameResolver.cc
* src/AsyncNameResolver.h
* src/BNode.cc
* src/BNode.h
* src/BitfieldMan.cc
* src/BitfieldMan.h
* src/BtAbortOutstandingRequestEvent.h
* src/BtExtendedMessage.cc
* src/BtExtendedMessage.h
* src/BtSeederStateChoke.cc
* src/BtSeederStateChoke.h
* src/Cookie.cc
* src/Cookie.h
* src/DHTBucket.cc
* src/DHTBucket.h
* src/DHTConnectionImpl.cc
* src/DHTConnectionImpl.h
* src/DHTFindNodeReplyMessage.cc
* src/DHTFindNodeReplyMessage.h
* src/DHTGetPeersReplyMessage.cc
* src/DHTGetPeersReplyMessage.h
* src/DHTInteractionCommand.cc
* src/DHTMessage.cc
* src/DHTMessage.h
* src/DHTMessageDispatcherImpl.cc
* src/DHTMessageEntry.cc
* src/DHTMessageReceiver.cc
* src/DHTMessageReceiver.h
* src/DHTMessageTrackerEntry.cc
* src/DHTMessageTrackerEntry.h
* src/DHTPeerAnnounceEntry.cc
* src/DHTPeerAnnounceEntry.h
* src/DHTPeerLookupTask.cc
* src/DHTPeerLookupTask.h
* src/DHTRoutingTableDeserializer.cc
* src/DHTRoutingTableDeserializer.h
* src/DefaultBtAnnounce.cc
* src/DefaultBtAnnounce.h
* src/DefaultBtMessageDispatcher.cc
* src/DefaultBtMessageDispatcher.h
* src/DefaultBtRequestFactory.cc
* src/DefaultBtRequestFactory.h
* src/DiskAdaptor.cc
* src/DiskAdaptor.h
* src/DownloadContext.cc
* src/DownloadContext.h
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/EpollEventPoll.cc
* src/EpollEventPoll.h
* src/FtpConnection.cc
* src/FtpConnection.h
* src/HttpConnection.cc
* src/HttpConnection.h
* src/HttpHeader.cc
* src/HttpHeader.h
* src/HttpRequest.cc
* src/HttpRequest.h
* src/HttpResponse.cc
* src/HttpResponse.h
* src/LibsslTLSContext.cc
* src/LibsslTLSContext.h
* src/MSEHandshake.cc
* src/MSEHandshake.h
* src/MetalinkEntry.cc
* src/MetalinkEntry.h
* src/MetalinkParserController.cc
* src/MetalinkParserController.h
* src/MetalinkParserStateMachine.cc
* src/MetalinkParserStateMachine.h
* src/MultiDiskAdaptor.cc
* src/MultiDiskAdaptor.h
* src/NetrcAuthResolver.cc
* src/NetrcAuthResolver.h
* src/Peer.cc
* src/Peer.h
* src/PeerSessionResource.cc
* src/PeerSessionResource.h
* src/Piece.cc
* src/Piece.h
* src/PieceStatMan.cc
* src/PieceStatMan.h
* src/Request.cc
* src/Request.h
* src/RequestGroup.cc
* src/RequestGroup.h
* src/RequestGroupMan.cc
* src/RequestGroupMan.h
* src/RequestSlot.cc
* src/RequestSlot.h
* src/SegmentMan.cc
* src/SegmentMan.h
* src/SelectEventPoll.cc
* src/SelectEventPoll.h
* src/ServerStat.cc
* src/ServerStat.h
* src/Signature.cc
* src/Signature.h
* src/URIResult.cc
* src/URIResult.h
* src/UTPexExtensionMessage.cc
* src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
Tatsuhiro Tsujikawa
0e70ba46a9
2009-04-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Increase prefixLength for the bucket which doesn't own local
node ID when splitting bucket.
* src/DHTBucket.cc
* test/DHTBucketTest.cc
2009-04-13 12:47:50 +00:00
Tatsuhiro Tsujikawa
5541477dce
2009-04-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Rewritten isInRange()
* src/DHTBucket.cc
* test/DHTBucketTest.cc
2009-04-01 12:28:39 +00:00
Tatsuhiro Tsujikawa
c1ba5c9745
2008-09-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Fixed the bug that prefixLength of split bucket which doesn't
include
local node ID is incremented.
* src/DHTBucket.cc
* src/DHTBucket.h
* test/DHTBucketTest.cc
2008-09-18 13:21:33 +00:00
Tatsuhiro Tsujikawa
6d78a7656d
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Changed method signature:
BNode::findClosestKNodes, BNode:: enumerateBucket,
DHTBucket::getGoodNodes,
DHTRoutingTable::getClosestKNodes, DHTRoutingTable::getBuckets
* src/BNode.cc
* src/BNode.h
* src/DHTAbstractNodeLookupTask.cc
* src/DHTAutoSaveCommand.cc
* src/DHTBucket.cc
* src/DHTBucket.h
* src/DHTBucketRefreshTask.cc
* src/DHTFindNodeMessage.cc
* src/DHTGetPeersMessage.cc
* src/DHTRoutingTable.cc
* src/DHTRoutingTable.h
* test/BNodeTest.cc
* test/DHTBucketTest.cc
* test/DHTRoutingTableTest.cc
2008-05-11 08:07:57 +00:00
Tatsuhiro Tsujikawa
3505201f33
2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Rewritten SharedHandle. Now copy constructor taking raw pointer
has
keyword explicit and SharedHandle's default constructor
initializes
its internal obj to null, old implementation initializes it
using
obj's default constructor.
To assign null, write SharedHandle<T> x(...); x.reset();
TODO: test/SharedHandleTest.cc needs more tests.
* src/SharedHandle.h
2008-04-20 00:50:22 +00:00
Tatsuhiro Tsujikawa
852315bf11
2008-03-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Fixed high memory footprint when DHT is enabled.
This is not a memory leak, but DHTReplaceNodeTask is more frequently
queued than it is processed and the queue is getting longer. As a
consequence, momory usage is increased.
As for a fix, instead of issuing DHTReplaceNodeTask, I've implemented
replacement cache in DHTBucket which is described in Kademlia paper.
* src/DHTRoutingTable.cc (addNode): Removed the issuing of
DHTReplaceNodeTask.
* src/DHTBucket.{h, cc}
(cacheNode): New function.
(getCachedNodes): New function.
(dropNode): Push back cached node to _nodes.
* test/DHTBucketTest.cc
(testCacheNode): New test
(testDropNode): New test
2008-03-11 14:19:10 +00:00
Tatsuhiro Tsujikawa
f9afa5eeac
2008-02-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Fixed compile error on Mac OS X, on 64Bit OS maybe.
* src/DHTBucket.cc
Removed unnecessary cast.
* src/HandshakeExtensionMessage.cc
2008-02-27 13:16:04 +00:00
Tatsuhiro Tsujikawa
1b7c198289
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Removed "using namespace std;" from all sources. Appended std::
prefix to c++
standard classes.
Included string.h where mem* function are used.
2008-02-08 15:53:45 +00:00
Tatsuhiro Tsujikawa
0f13363229
2008-02-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Added DHT functionality, compatible with mainline.
DHT is disabled by default. To enable it, give --enable-dht to
aria2c.
You may need to specify entry point to DHT network using
--dht-entry-point. DHT uses UDP port to listen incoming message.
Use --dht-listen-port to specify port number. Make sure that
your
firewall configuration can pass through UDP traffic to the port.
The routing table is saved in $HOME/.aria2/dht.dat.
* src/DHT*
* src/BNode.{h, cc}
* src/PeerInteractionCommand.cc: enable DHT functionality for a
particular torrent.
* src/Data.cc: Rewritten ctor.
* src/OptionHandlerFactory.cc: Added --enable-dht,
--dht-listen-port,
--dht-entry-point.
* src/DefaultBtInteractive.cc: Send port message if dht is
enabled.
* src/RequestGroup.cc: Initialize DHT functionality. When
download
ends, remove BtContext from DHTPeerAnnounceStorage.
* src/BtPortMessage.{h, cc}: Rewritten.
* src/message.h
* src/OptionHandlerImpl.cc
* src/option_processing.cc: Added --enable-dht,
--dht-listen-port,
--dht-entry-point.
* src/Dictionary.{h, cc} (remove): New function.
* src/prefs.h
* src/DefaultBtMessageFactory.h
* src/BtHandshakeMessage.cc
* src/ActivePeerConnectionCommand.cc
* src/SocketCore.{h, cc}: Added datagram socket support.
* src/DefaultBtMessageFactory.cc
* src/BtSetup.cc: Add BtContext to DHTPeerAnnounceStorage here.
Create DHT commands.
* src/BtMessageFactory.h
* src/PeerMessageUtil.{h, cc}
2008-02-01 17:36:33 +00:00