Commit Graph

17 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa
b1132d6b10 make clang-format using clang-format-3.6 2015-12-27 18:40:08 +09:00
Tatsuhiro Tsujikawa
81f46fbf92 Use CXX11_OVERRIDE 2013-07-06 18:15:09 +09:00
Tatsuhiro Tsujikawa
07d270c87e Require -std=c++11 and use std::shared_ptr instead of SharedHandle 2013-06-22 01:10:38 +09:00
Tatsuhiro Tsujikawa
c893d82867 Removed BtMessage::isSendingProgress()
DefaultBtMessageDispatcher::isSendingInProgress() now checks the
number of buffer entry in PeerConnection.
2013-01-11 20:26:31 +09:00
Tatsuhiro Tsujikawa
8b0c701266 Removed trailing spaces 2012-10-01 23:52:22 +09:00
Tatsuhiro Tsujikawa
2b458da480 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made #include guard consistent for c++ header files.
2010-10-31 07:23:53 +00:00
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
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
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
c1730aeea9 2009-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed ut_metadata data handling. Implemented
	UTMetadataDataExtensionMessage::doReceivedAction().  Initialize
	PeerStorage in HandshakeExtensionMessage::doReceivedAction() when
	metadata_size is received.
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.h
	* src/UTMetadataDataExtensionMessage.cc
	* src/UTMetadataDataExtensionMessage.h
	* src/UTMetadataRequestExtensionMessage.cc
	* src/UTMetadataRequestFactory.cc
	* src/UTMetadataRequestFactory.h
	* src/UTMetadataRequestTracker.cc
	* src/UTMetadataRequestTracker.h
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/HandshakeExtensionMessageTest.cc
	* test/MockBtMessage.h
	* test/UTMetadataDataExtensionMessageTest.cc
	* test/UTMetadataRequestExtensionMessageTest.cc
	* test/UTMetadataRequestFactoryTest.cc
	* test/UTMetadataRequestTrackerTest.cc
	* test/extension_message_test_helper.h
2009-11-22 15:31:47 +00:00
Tatsuhiro Tsujikawa
afdd61f9d1 2009-04-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten event dispatch in BtMessage. Removed BtEventListener,
	BtEvent.	
	* src/AbstractBtEventListener.h: Removed.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/BtAbortOutstandingRequestEvent.h
	* src/BtCancelSendingPieceEvent.h
	* src/BtChokedEvent.h: Removed.
	* src/BtChokingEvent.h
	* src/BtEvent.h: Removed
	* src/BtEventListener.h: Removed.
	* src/BtMessage.h
	* src/BtPieceMessage.cc
	* src/BtPieceMessage.h
	* src/BtRequestMessage.cc
	* src/BtRequestMessage.h
	* src/DefaultBtMessageDispatcher.cc
	* src/Makefile.am
	* src/a2functional.h
	* test/BtPieceMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/MockBtMessage.h
2009-04-21 14:52:04 +00:00
Tatsuhiro Tsujikawa
4e0c03500c 2009-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
BtMessage now holds _id attribute.  MESSAGE_LENGTH that is
	declared as non-const previously is now const and defined in
	class definition.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/BtAllowedFastMessage.cc
	* src/BtAllowedFastMessage.h
	* src/BtBitfieldMessage.h
	* src/BtCancelMessage.cc
	* src/BtCancelMessage.h
	* src/BtChokeMessage.cc
	* src/BtChokeMessage.h
	* src/BtExtendedMessage.cc
	* src/BtExtendedMessage.h
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessage.h
	* src/BtHaveAllMessage.cc
	* src/BtHaveAllMessage.h
	* src/BtHaveMessage.cc
	* src/BtHaveMessage.h
	* src/BtHaveNoneMessage.cc
	* src/BtHaveNoneMessage.h
	* src/BtInterestedMessage.cc
	* src/BtInterestedMessage.h
	* src/BtKeepAliveMessage.cc
	* src/BtKeepAliveMessage.h
	* src/BtMessage.h
	* src/BtNotInterestedMessage.cc
	* src/BtNotInterestedMessage.h
	* src/BtPieceMessage.h
	* src/BtPortMessage.cc
	* src/BtPortMessage.h
	* src/BtRejectMessage.cc
	* src/BtRejectMessage.h
	* src/BtRequestMessage.cc
	* src/BtRequestMessage.h
	* src/BtSuggestPieceMessage.cc
	* src/BtSuggestPieceMessage.h
	* src/BtUnchokeMessage.cc
	* src/BtUnchokeMessage.h
	* src/SimpleBtMessage.cc
	* src/SimpleBtMessage.h
	* test/MockBtMessage.h
2009-03-11 15:44:04 +00:00
Tatsuhiro Tsujikawa
032c7c2808 2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
type cleanup for allmost all remaining files.
2008-03-09 12:24:01 +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
cd91e2ea4f 2007-01-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Xml2MetalinkProcessor.h
	(xpathExists): New function.
	* src/Xml2MetalinkProcessor.cc
	(xpathExists): New function.

	Not to send HEAD request if filename and size are available in 
Metalink
	file:
	* src/UrlRequestInfo.h
	(filename): New variable.
	(totalLength): New variable.
	(setTotalLength): New function.
	(setFilename): New function.
	* src/MetalinkRequestInfo.cc
	(execute): Set filename and size to UrlRequestInfo.
	* src/MetalinkEntry.cc
	(MetalinkEntry): Initialize size with 0.
	* src/UrlRequestInfo.cc
	(execute): Set filename and size to SegmentMan.
	
	Not to download rest of the files after selected files are 
downloaded
	in BitTorrent:
	* src/PieceStorage.h
	(allDownloadFinished): New function.
	* src/DefaultBtAnnounce.cc
	(isCompleteAnnounceReady): Use allDownloadFinished instead of
	downloadFinished.
	(getAnnounceUrl): Use allDownloadFinished instead of 
downloadFinished.
	* src/DefaultPieceStorage.cc
	(completePiece): Use allDownloadFinished instead of 
downloadFinished.
	Commented out the call to finishSelectiveDownloadingMode().
	(downloadFinished): Call isFilteredAllBitSet() instead of
	isAllBitSet().
	(allDownloadFinished): New function.
	* src/DefaultBtInteractive.cc
	(addBitfieldMessageToQueue): Call allDownloadFinished() instead 
of
	downloadFinished().
	(checkHave): Call allDownloadFinished() instead of 
downloadFinished().
	* src/TorrentDownloadEngine.cc
	(onEndOfRun): Call allDownloadFinished() instead of 
downloadFinished().
	* src/BitfieldMan.h
	(isFilteredAllBitSet): New function.
	* src/ShareRatioSeedCriteria.h
	(PieceStorage.h): New include.
	(pieceStorage): New variable.
	(evaluate):
	btContext->getTotalLength() -> 
pieceStorage->getCompletedLength()
	* src/BitfieldMan.cc
	(isFilteredAllBitSet): New function.
	(isAllBitSet): Filter is not took into account.
	
	Rename --force-truncate as --allow-overwrite:
	* src/TorrentRequestInfo.cc
	(execute): PREF_FORCE_TRUNCATE -> PREF_ALLOW_OVERWRITE
	* src/main.cc
	(showUsage): --force-truncate -> --allow-overwrite
	* src/message.h
	(EX_FILE_ALREADY_EXISTS): --force-truncate -> --allow-overwrite
	* src/prefs.h
	(PREF_FORCE_TRUNCATE): Removed.
	(PREF_ALLOW_OVERWRITE): New definition.
	* src/SegmentMan.cc
	(shouldCancelDownloadForSafety): --force-truncate -> 
--allow-overwrite
	
	* src/MetalinkRequestInfo.cc
	(execute): Queueing message are now logged in info level.

	* src/common.h
	(LONG_LONG_MAX): Removed.
	(LONG_LONG_MIN): Removed.
	* src/HttpResponseCommand.cc
	(handleDefaultEncoding): LONG_LONG_MAX -> INT64_MAX
	* src/FtpNegotiateCommand.cc
	(recvSize): LONG_LONG_MAX -> INT64_MAX
	
	* src/main.cc
	(showUsage): Added --check-integiry and 
--realtime-chunk-checksum
	command-line option.
	(main): Added --check-integiry and --realtime-chunk-checksum
	command-line option.
	--force-truncate -> --allow-overwrite
	Set initial value of --check-integrity option to false.
	Don't show usage when error occurs while persing command-line 
options.
	Removed deprecated --upload-limit option.
2007-01-28 14:18:35 +00:00
Tatsuhiro Tsujikawa
a413cb50f7 2006-12-24 15:55:59 +00:00
Tatsuhiro Tsujikawa
9c3e8fbd9c 2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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.
2006-12-24 06:25:21 +00:00