summaryrefslogtreecommitdiff
path: root/src/SimpleRandomizer.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2008-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-031-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged from trunk -r684:691 Removed wrong comment. * src/DefaultPeerStorage.cc Moved implementation to SimpleRandomizer.cc from SimpleRandomizer.h. Added return value of getpid() to argument of srand() to achieve more randomized value. * src/SimpleRandomizer.cc * src/SimpleRandomizer.h Contact tracker frequently when the number of connections are 0 and download is not finished yet. * src/ActivePeerConnectionCommand.cc * src/BtAnnounce.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * test/MockBtAnnounce.h Moved threshold values to UTPexExtensionMessage. * src/DefaultBtInteractive.cc * src/Peer.cc * src/Peer.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/UTPexExtensionMessageTest.cc Added _incoming member to Peer class and made it true if the peer initiated connection. Don't add those peer to UTPex message. If extended handshake is received, assign _incoming to false. * src/DefaultBtInteractive.cc * src/HandshakeExtensionMessage.cc * src/Peer.cc * src/Peer.h * src/PeerListenCommand.cc
* 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-201-1/+1
| | | | | | | | | | | | | | | 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-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-0/+4
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-02-06 Tatsuhiro Tsujikawa <tujikawa dot rednoah dot com>Tatsuhiro Tsujikawa2007-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | To fix the bug that causes crash on Max OS X: * src/SimpleRandomizer.h (getInstance): Create new instance if the static variable is null. * src/SimpleRandomizer.cc (randomizer): Initialized to 0. * src/BitfieldManFactory.h (getNewFactory): Removed the call to setRandomizer(). To fix the miscalculation of the range of checksum: * src/BitfieldMan.h (isBitSetOffsetRange): New function. * src/BitfieldMan.cc (isBitSetOffsetRange): New function. * src/SegmentMan.cc (tryChunkChecksumValidation): Use BitfieldMan::isBitSetOffsetRange(). Use bitfield->getBlockLength() instead of segment.segmentLength.
* 2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-12-241-0/+37
Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.