summaryrefslogtreecommitdiff
path: root/src/SimpleLogger.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-04-19 17:23:58 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-04-19 17:23:58 +0000
commite199bf88986ce441c3383e3c00ce4864a77023b2 (patch)
tree7fedb64bd0089a92251ae77aa0ec318aa35d33b6 /src/SimpleLogger.h
parent195aff51ba58e62a139f1a392208c88cccb3af3d (diff)
To add TrackerUpdateCommand with which replaces
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.
Diffstat (limited to 'src/SimpleLogger.h')
-rw-r--r--src/SimpleLogger.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SimpleLogger.h b/src/SimpleLogger.h
index 517ad26b..82c0cf4c 100644
--- a/src/SimpleLogger.h
+++ b/src/SimpleLogger.h
@@ -29,10 +29,12 @@ private:
void writeLog(int level, const char* msg, va_list ap, Exception* e = NULL) const;
FILE* file;
public:
- SimpleLogger(string filename);
+ SimpleLogger();
SimpleLogger(FILE* logfile);
~SimpleLogger();
+ void openFile(const string& filename);
+ void closeFile();
void debug(const char* msg, ...) const;
void debug(const char* msg, Exception* ex, ...) const;
void info(const char* msg, ...) const;