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.
To add --seed-time and --seed-ratio command-line option:
* src/Option.h (getAsDouble): New function.
* src/Option.cc (getAsDouble): New function.
* src/SeedCheckCommand.h: New class.
* src/SeedCheckCommand.cc: New class.
* src/DownloadEngineFactory.cc
(SeedCheckCommand.h): Included.
(UnionSeedCriteria.h): Included.
(TimeSeedCriteria.h): Included.
(ShareRatioSeedCriteria.h): Included.
(newTorrentConsoleEngine): Added the processing of seed option.
* src/SeedCriteria.h: New class.
* src/ShareRatioSeedCriteria.h: New class.
* src/TimeSeedCriteria.h: New class.
* src/UnionSeedCriteria.h: New class.
* src/prefs.h
(PREF_SEED_TIME): New definition.
(PREF_SEED_RATIO): New definition.
* src/main.cc
(showUsage): Added --seed-time and --seed-ratio option.
(main): Added --seed-time and --seed-ratio option.
Made default log file name "/dev/null".
* src/SharedHandle.h
(SharedHandle): Copy constructor. Made it assignable from the
SharedHandle of the subclasses.
(operator=): Made it assignable from the SharedHandle of the
subclasses.
(getRefCount): New function.
To add notice log level and the switch to write log to stdout.
This
switch is configurable per log level.
* src/Logger.h
(notice): New function.
(LEVEL): Added NOTICE. Assigned an explicit value to each log
level
constant.
* src/LogFactory.cc
(getInstance): The use of NullLogger was removed. A log message
with
notice log level was made written to stdout along with log file.
* src/NullLogger.h
(notice): New function.
* src/SimpleLogger.h
(writeHeader): Added the 'file' argument.
(writeLog): Added the 'file' argument.
(writeFile): New function.
(stdoutField): New variable.
(SimpleLogger): Removed the default constructor.
(SimpleLogger): Made the default value of logfile 0.
(debug): Added 'virtual' keyword.
(info): Added 'virtual' keyword.
(warn): Added 'virtual' keyword.
(error): Added 'virtual' keyword.
(notice): New function.
(setStdout): New function.
* src/SimpleLogger.cc
(WRITE_LOG): Replaced writeLog with writeFile.
(WRITE_LOG_EX): Replaced writeLog with writeFile.
(SimpleLogger): Removed the default constructor.
(setStdout): New function.
(writeLog): Added the handling of NOTICE log level.
(writeFile): New function.
(notice): New function.
* src/TorrentMan.h: Updated doc.
* src/BitfieldMan.h: Updated doc.
* src/TrackerWatcherCommand.cc
(execute): Return true if error occurred in the request to the
tracker
and halt is requested.
* src/TrackerUpdateCommand.cc
(execute): Return true if error occurred in the request to the
tracker
and halt is requested.
* src/TorrentConsoleDownloadEngine.h
(onSelectiveDownloadingCompletes): Removed.
* src/TorrentConsoleDownloadEngine.cc
(onSelectiveDownloadingCompletes): Removed.
* src/TorrentDownloadEngine.h
(onEndOfRun): Added 'virtual' keyword.
(afterEachIteration): Removed.
(onSelectiveDownloadingCompletes): Removed.
* src/TorrentDownloadEngine.cc
(onEndOfRun): Removed filenameFixed.
(afterEachIteration): Removed.
* src/TorrentMan.cc
(completePiece): Call onDownloadComplete here.
(onDownloadComplete): Added 2 log messages.
* src/TorrentMan.cc (setupInternal1): Fixed peerId generation
bug.
* src/SimpleLogger.h (writeHeader): New function.
* src/SimpleLogger.cc (writeHeader): New function.
(writeLog): Fixed the bug that causes segfaults if exception
message
contains an unescaped "%" character.
* src/TrackerWatcherCommand.cc (execute): Added a short sleep
when a tracker request fails.
* src/Request.cc (parseUrl): Query string is now handled
properly.
CompactTrackerResponseProcessor:
* src/TrackerWatcherCommand.h (req): Removed.
* src/TrackerWatcherCommand.cc (execute): Send a request to
tracker
if the number of peer connections are less than 30.
* src/ByteArrayDiskWriter.h (readData): Implemented.
* src/SegmentMan.h (diskWriter): New function.
* src/SegmentMan.cc (init): Added a call to
diskWriter->closeFile()
* src/main.cc : Removed #include
"CompactTrackerResponseProcessor.h"
(main): Use TrackerUpdateCommand.
* src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
(req): New variable.
(setTrackerResponseProcessor): Removed.
(getTrackerResponseProcessor): Removed.
(processTrackerResponse): Removed.
* src/DownloadEngine.h (diskWriter): Removed.
* src/TorrentDownloadEngine.cc (afterEachIteration): Removed a
call
to torrentMan->processTrackerResponse().
To add Util::expandBuffer:
* src/ByteArrayDiskWriter.h (expandBuffer): Removed.
* src/ByteArrayDiskWriter.cc (writeData): Use
Util::expandBuffer().
* src/Util.h (expandBuffer): New function.
To fix the bug that causes segmentation fault when "-l ." is
specified
in command-line option:
* src/SimpleLogger.h (SimpleLogger): Removed "filename"
argument.
(openFile): New function.
(closeFile): New function.
* src/SimpleLogger.cc (SimpleLogger): Removed fopen.
(~SimpleLogger): Call closeFile();
* src/LogFactory.cc (getInstance): Added a call to
slogger->openFile().
* src/main.cc (main): Added a check to see logger is configured
properly.
To enable HTTP authentication without specifying
"--http-auth-scheme"
* src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
* src/HttpConnection.cc (createRequest): Send Authorization
header
if PREF_HTTP_AUTH_ENABLED == V_TRUE.
* src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to
V_TRUE
* src/Peer.cc (shouldChoke): Updated algorithm.
* src/message.h (EX_AUTH_FAILED): New definition.
(EX_FILE_OPEN): New definition.
* src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
if status == 401.
(handleDefaultEncoding): Added a call to
diskWriter->initAndOpenFile()
if req->isTorrent == true.
* src/main.cc (handler): Removed the check to see e->diskWriter
!= NULL
(torrentHandler): Removed the check to see diskAdaptor != NULL.
* src/AbstractDiskWriter.cc (openExistingFile): Updated
messsage.
(createFile): Updated message.
* configure.in: Added gnutls support. Added several CPP macros.
* m4/openssl.m4: Added.
* src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
readData(), peekData(). Added gnutls support.
* src/HttpDownloadCommand.cc: Removed SleepCommand.h
* src/TrackerWatcherCommand.{h,cc}: Added. This command creates
TrackerInitCommand periodicaly(TorrentMan::minInterval).
* src/TorrentMan.cc: Remove downloadedSize == 0 check from
save().
Instead, added a check for whether setup method has executed
successfully.
* src/TorrentMan.h: Added member vaiable setupComplete. Updated
DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to
300.
* src/Makefile.am: Updated.
* src/messageDigest.h: Added. This is a macro calculating SHA1
digest
using whether OpenSSL or gcrypt, depending on the result of
configure
script.
* src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by
using
messageDigest.h.
* src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
* src/PeerListenCommand.cc: Added log about port binded
successfully.
Fixed memory leak.
* src/main.cc: Added gnutls support. Replaced LIB_SSL with
ENABLE_BITTORRENT where they are not related to OpenSSL but
BitTorrent.
Removed instantiation of TrackerInitCommand. Instead,
TrackerWatcherCommand is instantiated and pushed to the command
queue.
* src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL
with
ENABLE_SSL.
* src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
* src/RequestSlotMan.cc:
(deleteCompletedRequestSlot)
If a piece is already acquired by another command, delete the
request
slots for the piece.
* src/TrackerUpdateCommand.cc:
(execute)
Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to
warn.
Added a check whether peer list is null.
Fixed the bug that causes sending completed event to the tracker
several times.
* src/TrackerInitCommand.cc:
(execute)
Fixed the bug that causes sending completed event to the tracker
several times.
* src/AbstractDiskWriter.{h,cc}: Removed direct dependency on
OpenSSL
by using messageDigest.h.
2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* PeerConnection.cc: Replaced log message "keep-alive" with
"keep alive".
* PeerInteractionCommand.{h,cc}: Close connection if peer is
choking
localhost long time.
* TorrentMan.cc: When adding new peer with duplicate = true, if
the
number of peer list is equal to or grater than MAX_PEER_LIST,
delete
at most 100 failure entry from the list. If with duplicate =
false,
MAX_PEER_LIST is not checked.
* PeerListenCommand.cc: Fixed the argument order of log message.
2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
Added warn().
* SimpleLogger.h: Moved enum LEVEL to Logger.h.
Implemented warn().
Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated
code.