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
45fde1adaf
Cleaned up Exception constructors.
...
Removed Exception(const char*, int, const Exception&) ctor. Also
removed FatalException() copy ctor.
2010-11-28 21:03:11 +09:00
Tatsuhiro Tsujikawa
947967fc63
Renamed DownloadErrorCode.h as error_code.h. Renamed
...
downloaderrorcode::Value as error_code::Value.
2010-11-28 16:52:02 +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
c7795c63ce
2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Added separete *.cc files for exception classes.
* src/DlAbortEx.cc
* src/DlAbortEx.h
* src/DlRetryEx.cc
* src/DlRetryEx.h
* src/DownloadFailureException.cc
* src/DownloadFailureException.h
* src/FatalException.cc
* src/FatalException.h
* src/Makefile.am
* src/RecoverableException.cc
* src/RecoverableException.h
2010-06-20 11:56:33 +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
e82f870fdc
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Removed _uris from RequestGroup. All functions that refer to _uris
were moved to FileEntry. Exit status code are now defined in
DownloadResultCode.h.
* src/AbstractCommand.cc
* src/AdaptiveURISelector.cc
* src/AdaptiveURISelector.h
* src/AutoSaveCommand.cc
* src/BtPostDownloadHandler.cc
* src/CheckIntegrityDispatcherCommand.cc
* src/CookieStorage.cc
* src/DHTAutoSaveCommand.cc
* src/DHTBucketRefreshCommand.cc
* src/DHTEntryPointNameResolveCommand.cc
* src/DHTInteractionCommand.cc
* src/DHTPeerAnnounceCommand.cc
* src/DHTTokenUpdateCommand.cc
* src/DlAbortEx.h
* src/DlRetryEx.h
* src/DownloadCommand.cc
* src/DownloadContext.h
* src/DownloadFailureException.h
* src/DownloadResult.h
* src/DownloadResultCode.h
* src/FeedbackURISelector.cc
* src/FeedbackURISelector.h
* src/FileEntry.cc
* src/FileEntry.h
* src/FtpNegotiationCommand.cc
* src/HttpListenCommand.cc
* src/HttpResponseCommand.cc
* src/HttpServerResponseCommand.cc
* src/HttpSkipResponseCommand.cc
* src/InOrderURISelector.cc
* src/InOrderURISelector.h
* src/Makefile.am
* src/Makefile.in
* src/Metalink2RequestGroup.cc
* src/MultiUrlRequestInfo.cc
* src/MultiUrlRequestInfo.h
* src/OptionHandlerFactory.cc
* src/PeerListenCommand.cc
* src/RecoverableException.h
* src/RequestGroup.cc
* src/RequestGroup.h
* src/RequestGroupMan.cc
* src/RequestGroupMan.h
* src/TimedHaltCommand.cc
* src/TrackerWatcherCommand.cc
* src/URIResult.cc
* src/URIResult.h
* src/URISelector.h
* src/XmlRpcMethodImpl.cc
* src/bittorrent_helper.cc
* src/bittorrent_helper.h
* src/download_helper.cc
* src/main.cc
* src/option_processing.cc
* test/BtDependencyTest.cc
* test/BtPostDownloadHandlerTest.cc
* test/CookieStorageTest.cc
* test/DefaultBtMessageDispatcherTest.cc
* test/DownloadHandlerFactoryTest.cc
* test/DownloadHelperTest.cc
* test/FeedbackURISelectorTest.cc
* test/FileEntryTest.cc
* test/InOrderURISelectorTest.cc
* test/Metalink2RequestGroupTest.cc
* test/MetalinkPostDownloadHandlerTest.cc
* test/RequestGroupManTest.cc
* test/RequestGroupTest.cc
* test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
Tatsuhiro Tsujikawa
20e215047c
2009-05-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Added source filename(__FILE__) and line number(__LINE__) to
exception message.
* src/AbstractCommand.cc
* src/AbstractDiskWriter.cc
* src/AbstractProxyResponseCommand.cc
* src/BDE.h
* src/BtAllowedFastMessage.cc
* src/BtHandshakeMessageValidator.h
* src/BtHaveAllMessage.cc
* src/BtHaveNoneMessage.cc
* src/BtPieceMessage.cc
* src/BtRejectMessage.cc
* src/ChunkedDecoder.cc
* src/CookieStorage.cc
* src/DHTAnnouncePeerMessage.cc
* src/DHTEntryPointNameResolveCommand.cc
* src/DHTMessageFactoryImpl.cc
* src/DHTMessageTracker.cc
* src/DHTRoutingTableDeserializer.cc
* src/DHTRoutingTableSerializer.cc
* src/DHTSetup.cc
* src/DHTTokenTracker.cc
* src/DefaultBtAnnounce.cc
* src/DefaultBtContext.cc
* src/DefaultBtInteractive.cc
* src/DefaultBtMessageFactory.cc
* src/DefaultBtProgressInfoFile.cc
* src/DefaultExtensionMessageFactory.cc
* src/DlAbortEx.h
* src/DlRetryEx.h
* src/DownloadCommand.cc
* src/DownloadEngineFactory.cc
* src/DownloadFailureException.h
* src/Exception.cc
* src/Exception.h
* src/ExpatMetalinkProcessor.cc
* src/ExpatXmlRpcRequestProcessor.cc
* src/FallocFileAllocationIterator.cc
* src/FatalException.h
* src/FtpConnection.cc
* src/FtpFinishDownloadCommand.cc
* src/FtpInitiateConnectionCommand.cc
* src/FtpNegotiationCommand.cc
* src/GZipDecoder.cc
* src/HandshakeExtensionMessage.cc
* src/HttpConnection.cc
* src/HttpHeaderProcessor.cc
* src/HttpInitiateConnectionCommand.cc
* src/HttpResponse.cc
* src/HttpResponseCommand.cc
* src/HttpServer.cc
* src/HttpSkipResponseCommand.cc
* src/InitiateConnectionCommandFactory.cc
* src/IteratableChunkChecksumValidator.cc
* src/LibgcryptARC4Context.h
* src/LibgcryptARC4Decryptor.h
* src/LibgcryptARC4Encryptor.h
* src/LibgcryptDHKeyExchange.h
* src/LibgnutlsTLSContext.cc
* src/LibsslARC4Context.h
* src/LibsslARC4Decryptor.h
* src/LibsslARC4Encryptor.h
* src/LibsslDHKeyExchange.h
* src/LibsslTLSContext.cc
* src/MSEHandshake.cc
* src/MessageDigestHelper.cc
* src/MetalinkHelper.cc
* src/MultiDiskAdaptor.cc
* src/NameMatchOptionHandler.h
* src/NameResolver.cc
* src/Netrc.cc
* src/NsCookieParser.cc
* src/OptionHandlerException.cc
* src/OptionHandlerException.h
* src/OptionHandlerImpl.h
* src/OptionParser.cc
* src/ParameterizedStringParser.cc
* src/PeerAbstractCommand.cc
* src/PeerConnection.cc
* src/PeerMessageUtil.cc
* src/PeerReceiveHandshakeCommand.cc
* src/Platform.cc
* src/ReceiverMSEHandshakeCommand.cc
* src/RecoverableException.h
* src/RequestGroup.cc
* src/SimpleLogger.cc
* src/SocketCore.cc
* src/Sqlite3MozCookieParser.cc
* src/UTPexExtensionMessage.cc
* src/Util.cc
* src/XML2SAXMetalinkProcessor.cc
* src/Xml2XmlRpcRequestProcessor.cc
* src/XmlRpcMethodImpl.cc
* src/bencode.cc
* src/download_helper.cc
* src/messageDigest.h
* test/ExceptionTest.cc
* test/TestUtil.cc
2009-05-18 15:07:15 +00:00
Tatsuhiro Tsujikawa
8a9d921465
2009-01-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
...
Applied exit-status patch from Pascal Rigaux at Mandriva. aria2
now returns last error encountered in the HTTP/FTP downloads as
a exit status value. If all downloads finished successfully,
aria2 returns 0. The error code is defined in
src/DownloadResult.h.
The error occurred in the download currently in progress is not
reported as a last error. If no error has encountered but there
are in progress or waiting downloads, aria2 returns 7.
* src/AbstractCommand.cc
* src/DlAbortEx.h
* src/DlRetryEx.h
* src/DownloadCommand.cc
* src/DownloadFailureException.h
* src/DownloadResult.h
* src/FtpNegotiationCommand.cc
* src/HttpSkipResponseCommand.cc
* src/Makefile.am
* src/MultiUrlRequestInfo.cc
* src/MultiUrlRequestInfo.h
* src/RecoverableException.h
* src/RequestGroup.cc
* src/RequestGroup.h
* src/RequestGroupMan.cc
* src/RequestGroupMan.h
* src/URIResult.cc
* src/URIResult.h
* src/main.cc
* src/option_processing.cc
* test/RequestGroupTest.cc
2009-01-12 12:27:34 +00:00
Tatsuhiro Tsujikawa
1ef99931e1
2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
Rewritten Exception class. Throw exception object, not its pointer and
catch by reference, so that remove problematic delete operator for
catched exception.
* src/Exception.cc
* src/Exception.h
* test/ExceptionTest.cc
* src/*: All files throwing/catching exception.
* test/*: All files throwing/catching exception.
2008-04-27 02:22:14 +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
d28e6aca15
2007-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
To add RecoverableException, FatalException:
* src/AbstractCommand.cc
(onAbort): Exception -> RecoverableException
* src/PeerAbstractCommand.h
(RecoverableException.h): New include.
(onAbort): Exception -> RecoverableException.
* src/PeerInteractionCommand.cc
(onAbort): Exception -> RecoverableException.
* src/PeerAbstractCommand.cc
(execute): Exception -> RecoverableException.
(onAbort): Exception -> RecoverableException.
* src/TorrentRequestInfo.cc
(execute): Exception -> RecoverableException.
* src/MetalinkRequestInfo.cc
(execute): Exception -> RecoverableException.
* src/MetaFileUtil.cc: RecoverableException.
* src/AbstractCommand.h
(onAbort): Exception -> RecoverableException.
* src/DlRetryEx.h: Exception -> RecoverableException.
* src/DlAbortEx.h: Exception -> RecoverableException.
* src/PeerListenCommand.cc: Exception -> RecoverableException.
* src/Util.cc: Exception -> RecoverableException.
* src/DefauldDiskWriter.cc: Exception -> RecoverableException.
* src/TrackerUpdateCommand.cc: Exception ->
RecoverableException.
* src/UrlRequestInfo.cc: Exception -> RecoverableException.
To make ID static const int
* src/BtInterestedMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtPieceMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtChokeMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtHaveAllMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtKeepAliveMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtHandshakeMessage.h
(ID): New variable.
(getId): Made non-const.
* src/BtSuggestPieceMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtPortMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/AbstractBtMessage.h
(id): Removed.
(AbstractBtMessage): Removed id.
(getId): Removed.
* src/BtHaveMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtAllowedFastMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtCancelMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtNotInterestedMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtChokeMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtRejectMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtBitfieldMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtUnchokeMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtRequestMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
* src/BtHaveMessage.h
(ID_t): Removed.
(ID): New variable.
(getId): Made non-const.
To add --force-truncate command-line option and a check whether
the file already exists:
* src/DirectDiskAdaptor.h
(getFilePath): Made virtual public.
* src/MultiDiskAdaptor.h
(File.h): New include.
(DiskWriterEntry::fileEntry): Made private.
(DiskWriterEntry::fileExists): New function.
(DiskWriterEntry::getFileEntry): New function.
(fileExists): New function.
(getFilePath): New function.
* src/TorrentRequestInfo.cc
(FatalException.h): New include.
(message.h): New include.
(RecoverableException.h): New include.
(execute): Added a check whether file is already exists or not.
* src/DiskAdaptor.h
(fileExists): New function.
(getFilePath): New function.
* src/main.cc
(showUsage): Added an explanation of --force-truncate
command-line
option.
(main): Added --force-truncate command-line option.
* src/Exception.h
(setMsg): buf[256] -> buf[1024]
* src/CopyDiskWriter.h
(getFilePath): Made public virtual.
* src/MultiDiskAdaptor.cc: fileEntry -> getFileEntry()
(fileExists): New function.
* src/DownloadEngineFactory.cc
(newTorrentConsoleEngine): Don't open file here.
* src/message.h
(EX_FILE_ALREADY_EXISTS): New definition.
* src/prefs.h
(PREF_FOECE_TRUNCATE): New definition.
* src/HttpResponseCommand.cc
(handleDefaultEncoding): Added a check whether the file already
exists.
* src/SegmentMan.h
(fileExists): New function.
(shouldCancelDownloadForSafety): New function.
* src/FtpNegotiateCommand.cc
(recvSize): Added a check whether the file already exists.
* src/AbstractSingleDiskAdaptor.cc
(File.h): New include.
(fileExists): New function.
* src/AbstractSingleDiskAdaptor.h
(getFilePath): Removed.
(fileExists): New function.
* src/SegmentMan.cc
(fileExists): New function.
(shouldCancelDownloadForSafety): New function.
To fix regression bug in torrent downloading:
* src/DefaultBtRequestFactory.cc
(doChokedAction): New function.
* src/DefaultBtRequestFactory.h
(doChokedAction): New function.
* src/DefaultBtMessageDispatcher.cc
(doChokedAction): Do not delete request if its target is in
allowed
fast set.
* src/DefaultBtInteractive.cc
(doPostHandshakeProcessing): Added a call to
sendPendingMessage().
(sendKeepAlive): Send keep alive message even if the outgoing
message
queue is not empty.
(decideInterest): Simplified the code.
(fillPiece): Remove a call to dispatcher->doChokedAction()
because
it is already called when BtChokeMessage is received from a
peer.
* src/BtRequestFactory.h
(doChokedAction): New function.
To clean up code:
* src/PeerInteractionCommand.h
(executeInternal): Added virtual keyword explicitly.
(prepareForRetry): Added virtual keyword explicitly.
(prepareForNextPeer): Added virtual keyword explicitly.
(onAbort): Added virtual keyword explicitly.
* src/RequestSlot.cc
(isTimeout): Use Time::elapsed() instead of
differenceInMillis().
* src/BtPieceMessage.cc
(doReceivedAction): Added a debug log of piece's bitfield.
* src/Piece.h
(getBitfieldLength): New function.
* src/ByteArrayDiskWriter.cc
(clear): Added buf = 0 to avoid double free corruption.
* src/FileAllocator.cc
(allocate): Fixed an assignment of
fileAllocationMonitor->currentValue.
Added cp.reset().
* src/BitfieldMan.h
(operator=): Rewritten.
* src/BitfieldMan.cc
(BitfieldMan): Initialized bitfield, useBitfield.
* src/PeerConnection.cc
(receiveMessage): Added a call to socket->readable() after
getting
message length to avoid possible EOF.
* src/Util.cc
(torrentUrlencode): Fixed an encodeing bug. BUG#1629912
2007-01-11 16:32:31 +00:00
Tatsuhiro Tsujikawa
458cc27462
2006-12-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
To know root cause of exception:
* src/Exception.h
(cause): New variable.
(Exception): Added a parameter.
(getMsg): Return const reference to msg.
(getCause): New function.
* src/DlRetryEx.h
(DlRetryEx): Added a parameter 'cause'.
Added an overloaded constructor.
(DlAbortEx): Added a parameter 'cause'.
Added an overloaded constructor.
* src/SimpleLogger.cc
(writeLog): Log nested exception messages recursively.
2006-12-01 09:31:46 +00:00
Tatsuhiro Tsujikawa
1b5af8e829
2006-09-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
...
* src/*.{h,cc}:
Added an exception to the license which allows linking with
OpenSSL.
2006-09-21 15:31:24 +00:00
Tatsuhiro Tsujikawa
27d392d5f2
2006-02-22 12:16:10 +00:00
Tatsuhiro Tsujikawa
52634627bc
Initial import
2006-02-17 13:35:04 +00:00