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