Update of /cvsroot/dcplusplus/dcplusplus/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10847/client Modified Files: DownloadManager.h FavoriteManager.cpp LogManager.h ConnectionManager.h QueueItem.h ConnectionManager.cpp BufferedSocket.h NmdcHub.h TimerManager.h MerkleTree.h Socket.h ResourceManager.h SearchManager.h Client.h AdcHub.h TigerHash.h ShareManager.h HashManager.h Exception.h BitOutputStream.h UploadManager.h Semaphore.h QueueManager.cpp StringTokenizer.h SimpleXML.h StringSearch.h ConnectionManagerListener.h Client.cpp BufferedSocket.cpp SFVReader.h Util.h BloomFilter.h CriticalSection.h BitInputStream.h UserConnection.h ShareManager.cpp File.h Streams.h User.h Thread.h SettingsManager.h DownloadManager.cpp QueueManager.h FinishedManager.h UserCommand.h Pointer.h Makefile.am CryptoManager.cpp HttpConnection.h DirectoryListing.h ServerSocket.h HashManager.cpp DirectoryListing.cpp FavoriteManager.h CryptoManager.h MerkleCheckOutputStream.h Speaker.h HashValue.h Log Message: Pedantry Index: FinishedManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/FinishedManager.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** FinishedManager.h 24 Apr 2005 08:13:11 -0000 1.17 --- FinishedManager.h 19 Feb 2006 16:19:06 -0000 1.18 *************** *** 45,49 **** } ! int64_t getAvgSpeed() { return milliSeconds > 0 ? (chunkSize * ((int64_t)1000) / milliSeconds) : 0; }; GETSET(string, target, Target); --- 45,49 ---- } ! int64_t getAvgSpeed() { return milliSeconds > 0 ? (chunkSize * ((int64_t)1000) / milliSeconds) : 0; } GETSET(string, target, Target); *************** *** 84,89 **** { public: ! FinishedItem::List& lockList(bool upload = false) { cs.enter(); return upload ? uploads : downloads; }; ! void unlockList() { cs.leave(); }; void remove(FinishedItem *item, bool upload = false); --- 84,89 ---- { public: ! FinishedItem::List& lockList(bool upload = false) { cs.enter(); return upload ? uploads : downloads; } ! void unlockList() { cs.leave(); } void remove(FinishedItem *item, bool upload = false); Index: BloomFilter.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/BloomFilter.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BloomFilter.h 24 Apr 2005 08:13:10 -0000 1.10 --- BloomFilter.h 19 Feb 2006 16:19:06 -0000 1.11 *************** *** 35,40 **** class BloomFilter { public: ! BloomFilter(size_t tableSize) { table.resize(tableSize); }; ! ~BloomFilter() { }; void add(const string& s) { xadd(s, N); } --- 35,40 ---- class BloomFilter { public: ! BloomFilter(size_t tableSize) { table.resize(tableSize); } ! ~BloomFilter() { } void add(const string& s) { xadd(s, N); } Index: BufferedSocket.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/BufferedSocket.h,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** BufferedSocket.h 17 Feb 2006 19:23:51 -0000 1.77 --- BufferedSocket.h 19 Feb 2006 16:19:06 -0000 1.78 *************** *** 72,81 **** static BufferedSocket* getSocket(char sep) throw() { return new BufferedSocket(sep); ! }; static void putSocket(BufferedSocket* aSock) { aSock->removeListeners(); aSock->shutdown(); ! }; static void waitShutdown() { --- 72,81 ---- static BufferedSocket* getSocket(char sep) throw() { return new BufferedSocket(sep); ! } static void putSocket(BufferedSocket* aSock) { aSock->removeListeners(); aSock->shutdown(); ! } static void waitShutdown() { *************** *** 95,99 **** */ void setLineMode(size_t aRollback) { mode = MODE_LINE; rollback = aRollback; } ! Modes getMode() const { return mode; }; const string& getIp() { return sock ? sock->getIp() : Util::emptyString; } bool isConnected() { return sock && sock->isConnected(); } --- 95,99 ---- */ void setLineMode(size_t aRollback) { mode = MODE_LINE; rollback = aRollback; } ! Modes getMode() const { return mode; } const string& getIp() { return sock ? sock->getIp() : Util::emptyString; } bool isConnected() { return sock && sock->isConnected(); } *************** *** 120,124 **** struct TaskData { ! virtual ~TaskData() { }; }; struct ConnectInfo : public TaskData { --- 120,124 ---- struct TaskData { ! virtual ~TaskData() { } }; struct ConnectInfo : public TaskData { Index: File.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/File.h,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** File.h 12 Oct 2005 14:02:53 -0000 1.53 --- File.h 19 Feb 2006 16:19:06 -0000 1.54 *************** *** 102,106 **** } ! bool isOpen() { return h != INVALID_HANDLE_VALUE; }; virtual void close() throw() { --- 102,106 ---- } ! bool isOpen() { return h != INVALID_HANDLE_VALUE; } virtual void close() throw() { *************** *** 260,264 **** } ! bool isOpen() { return h != -1; }; virtual void close() throw() { --- 260,264 ---- } ! bool isOpen() { return h != -1; } virtual void close() throw() { *************** *** 281,287 **** } ! virtual void setPos(int64_t pos) throw(FileException) { lseek(h, (off_t)pos, SEEK_SET); }; ! virtual void setEndPos(int64_t pos) throw(FileException) { lseek(h, (off_t)pos, SEEK_END); }; ! virtual void movePos(int64_t pos) throw(FileException) { lseek(h, (off_t)pos, SEEK_CUR); }; virtual size_t read(void* buf, size_t& len) throw(FileException) { --- 281,287 ---- } ! virtual void setPos(int64_t pos) throw(FileException) { lseek(h, (off_t)pos, SEEK_SET); } ! virtual void setEndPos(int64_t pos) throw(FileException) { lseek(h, (off_t)pos, SEEK_END); } ! virtual void movePos(int64_t pos) throw(FileException) { lseek(h, (off_t)pos, SEEK_CUR); } virtual size_t read(void* buf, size_t& len) throw(FileException) { *************** *** 343,347 **** } ! static void deleteFile(const string& aFileName) throw() { ::unlink(aFileName.c_str()); }; /* ::rename seems to have problems when source and target is on different partitions --- 343,347 ---- } ! static void deleteFile(const string& aFileName) throw() { ::unlink(aFileName.c_str()); } /* ::rename seems to have problems when source and target is on different partitions *************** *** 419,423 **** } ! void write(const string& aString) throw(FileException) { write((void*)aString.data(), aString.size()); }; protected: --- 419,423 ---- } ! void write(const string& aString) throw(FileException) { write((void*)aString.data(), aString.size()); } protected: Index: Exception.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/Exception.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Exception.h 24 Apr 2005 08:13:36 -0000 1.18 --- Exception.h 19 Feb 2006 16:19:06 -0000 1.19 *************** *** 27,34 **** { public: ! Exception() { }; ! Exception(const string& aError) throw() : error(aError) { dcdrun(if(error.size()>0)) dcdebug("Thrown: %s\n", error.c_str()); }; ! virtual ~Exception() throw() { }; ! virtual const string& getError() const throw() { return error; }; protected: string error; --- 27,34 ---- { public: ! Exception() { } ! Exception(const string& aError) throw() : error(aError) { dcdrun(if(error.size()>0)) dcdebug("Thrown: %s\n", error.c_str()); } ! virtual ~Exception() throw() { } ! virtual const string& getError() const throw() { return error; } protected: string error; Index: UserCommand.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/UserCommand.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** UserCommand.h 24 Apr 2005 08:13:37 -0000 1.13 --- UserCommand.h 19 Feb 2006 16:19:06 -0000 1.14 *************** *** 50,56 **** }; ! UserCommand() : cid(0), type(0), ctx(0) { }; UserCommand(int aId, int aType, int aCtx, int aFlags, const string& aName, const string& aCommand, const string& aHub) throw() ! : Flags(aFlags), cid(aId), type(aType), ctx(aCtx), name(aName), command(aCommand), hub(aHub) { }; UserCommand(const UserCommand& rhs) : Flags(rhs), cid(rhs.cid), type(rhs.type), --- 50,56 ---- }; ! UserCommand() : cid(0), type(0), ctx(0) { } UserCommand(int aId, int aType, int aCtx, int aFlags, const string& aName, const string& aCommand, const string& aHub) throw() ! : Flags(aFlags), cid(aId), type(aType), ctx(aCtx), name(aName), command(aCommand), hub(aHub) { } UserCommand(const UserCommand& rhs) : Flags(rhs), cid(rhs.cid), type(rhs.type), Index: ConnectionManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/ConnectionManager.h,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ConnectionManager.h 29 Jan 2006 18:48:25 -0000 1.76 --- ConnectionManager.h 19 Feb 2006 16:19:06 -0000 1.77 *************** *** 47,51 **** }; ! ConnectionQueueItem(const User::Ptr& aUser, bool aDownload) : state(WAITING), lastAttempt(0), download(aDownload), user(aUser) { }; User::Ptr& getUser() { return user; } --- 47,51 ---- }; ! ConnectionQueueItem(const User::Ptr& aUser, bool aDownload) : state(WAITING), lastAttempt(0), download(aDownload), user(aUser) { } User::Ptr& getUser() { return user; } *************** *** 166,170 **** ConnectionManager(); ! virtual ~ConnectionManager() throw() { shutdown(); }; UserConnection* getConnection(bool aNmdc, bool secure) throw(); --- 166,170 ---- ConnectionManager(); ! virtual ~ConnectionManager() throw() { shutdown(); } UserConnection* getConnection(bool aNmdc, bool secure) throw(); Index: QueueItem.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/QueueItem.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** QueueItem.h 1 Jan 2006 22:42:54 -0000 1.24 --- QueueItem.h 19 Feb 2006 16:19:06 -0000 1.25 *************** *** 107,117 **** }; ! Source(const User::Ptr& aUser, const string& aPath) : path(aPath), user(aUser) { }; Source(const Source& aSource) : Flags(aSource), path(aSource.path), user(aSource.user) { } ! User::Ptr& getUser() { return user; }; ! const User::Ptr& getUser() const { return user; }; ! void setUser(const User::Ptr& aUser) { user = aUser; }; ! string getFileName() { return Util::getFileName(path); }; GETSET(string, path, Path); --- 107,117 ---- }; ! Source(const User::Ptr& aUser, const string& aPath) : path(aPath), user(aUser) { } Source(const Source& aSource) : Flags(aSource), path(aSource.path), user(aSource.user) { } ! User::Ptr& getUser() { return user; } ! const User::Ptr& getUser() const { return user; } ! void setUser(const User::Ptr& aUser) { user = aUser; } ! string getFileName() { return Util::getFileName(path); } GETSET(string, path, Path); *************** *** 126,130 **** priority(aPriority), current(NULL), currentDownload(NULL), added(aAdded), tthRoot(tth == NULL ? NULL : new TTHValue(*tth)) ! { }; QueueItem(const QueueItem& rhs) : --- 126,130 ---- priority(aPriority), current(NULL), currentDownload(NULL), added(aAdded), tthRoot(tth == NULL ? NULL : new TTHValue(*tth)) ! { } QueueItem(const QueueItem& rhs) : *************** *** 147,151 **** for_each(badSources.begin(), badSources.end(), DeleteFunction()); delete tthRoot; ! }; int countOnlineUsers() const { --- 147,151 ---- for_each(badSources.begin(), badSources.end(), DeleteFunction()); delete tthRoot; ! } int countOnlineUsers() const { *************** *** 158,162 **** return n; } ! bool hasOnlineUsers() const { return countOnlineUsers() > 0; }; const string& getSourcePath(const User::Ptr& aUser) { --- 158,162 ---- return n; } ! bool hasOnlineUsers() const { return countOnlineUsers() > 0; } const string& getSourcePath(const User::Ptr& aUser) { *************** *** 165,170 **** } ! Source::List& getSources() { return sources; }; ! Source::List& getBadSources() { return badSources; }; void getOnlineUsers(User::List& l) const { --- 165,170 ---- } ! Source::List& getSources() { return sources; } ! Source::List& getBadSources() { return badSources; } void getOnlineUsers(User::List& l) const { *************** *** 174,187 **** } ! string getTargetFileName() const { return Util::getFileName(getTarget()); }; ! Source::Iter getSource(const User::Ptr& aUser) { return getSource(aUser, sources); }; ! Source::Iter getBadSource(const User::Ptr& aUser) { return getSource(aUser, badSources); }; ! bool isSource(const User::Ptr& aUser) { return (getSource(aUser, sources) != sources.end()); }; ! bool isBadSource(const User::Ptr& aUser) { return (getSource(aUser, badSources) != badSources.end()); }; ! bool isSource(const User::Ptr& aUser) const { return isSource(aUser, sources); }; ! bool isBadSource(const User::Ptr& aUser) const { return isSource(aUser, badSources); }; bool isBadSourceExcept(const User::Ptr& aUser, Flags::MaskType exceptions) const { Source::ConstIter i = getSource(aUser, badSources); --- 174,187 ---- } ! string getTargetFileName() const { return Util::getFileName(getTarget()); } ! Source::Iter getSource(const User::Ptr& aUser) { return getSource(aUser, sources); } ! Source::Iter getBadSource(const User::Ptr& aUser) { return getSource(aUser, badSources); } ! bool isSource(const User::Ptr& aUser) { return (getSource(aUser, sources) != sources.end()); } ! bool isBadSource(const User::Ptr& aUser) { return (getSource(aUser, badSources) != badSources.end()); } ! bool isSource(const User::Ptr& aUser) const { return isSource(aUser, sources); } ! bool isBadSource(const User::Ptr& aUser) const { return isSource(aUser, badSources); } bool isBadSourceExcept(const User::Ptr& aUser, Flags::MaskType exceptions) const { Source::ConstIter i = getSource(aUser, badSources); *************** *** 189,193 **** return (*i)->isAnySet(exceptions^Source::FLAG_MASK); return false; ! }; void setCurrent(const User::Ptr& aUser) { --- 189,193 ---- return (*i)->isAnySet(exceptions^Source::FLAG_MASK); return false; ! } void setCurrent(const User::Ptr& aUser) { Index: NmdcHub.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/NmdcHub.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** NmdcHub.h 29 Jan 2006 18:48:25 -0000 1.30 --- NmdcHub.h 19 Feb 2006 16:19:06 -0000 1.31 *************** *** 62,66 **** virtual int64_t getAvailable() const; ! virtual string escape(string const& str) const { return Util::validateMessage(str, false); }; virtual void disconnect(bool graceless) throw(); --- 62,66 ---- virtual int64_t getAvailable() const; ! virtual string escape(string const& str) const { return Util::validateMessage(str, false); } virtual void disconnect(bool graceless) throw(); *************** *** 73,80 **** void validateNick(const string& aNick) { send("$ValidateNick " + toNmdc(aNick) + "|"); } ! void key(const string& aKey) { send("$Key " + aKey + "|"); }; ! void version() { send("$Version 1,0091|"); }; ! void getNickList() { checkstate(); send("$GetNickList|"); }; ! void getInfo(const OnlineUser& aUser) { checkstate(); send("$GetINFO " + toNmdc(aUser.getIdentity().getNick()) + " " + toNmdc(getMyNick()) + "|"); }; void connectToMe(const OnlineUser& aUser); --- 73,80 ---- void validateNick(const string& aNick) { send("$ValidateNick " + toNmdc(aNick) + "|"); } ! void key(const string& aKey) { send("$Key " + aKey + "|"); } ! void version() { send("$Version 1,0091|"); } ! void getNickList() { checkstate(); send("$GetNickList|"); } ! void getInfo(const OnlineUser& aUser) { checkstate(); send("$GetINFO " + toNmdc(aUser.getIdentity().getNick()) + " " + toNmdc(getMyNick()) + "|"); } void connectToMe(const OnlineUser& aUser); Index: DirectoryListing.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/DirectoryListing.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** DirectoryListing.h 1 Jan 2006 22:42:54 -0000 1.45 --- DirectoryListing.h 19 Feb 2006 16:19:06 -0000 1.46 *************** *** 50,58 **** name(aName), size(aSize), parent(aDir), tthRoot(new TTHValue(aTTH)), adls(false) { ! }; File(Directory* aDir, const string& aName, int64_t aSize) throw() : name(aName), size(aSize), parent(aDir), tthRoot(NULL), adls(false) { ! }; File(const File& rhs, bool _adls = false) : name(rhs.name), size(rhs.size), parent(rhs.parent), tthRoot(rhs.tthRoot == NULL ? NULL : new TTHValue(*rhs.tthRoot)), adls(_adls) --- 50,58 ---- name(aName), size(aSize), parent(aDir), tthRoot(new TTHValue(aTTH)), adls(false) { ! } File(Directory* aDir, const string& aName, int64_t aSize) throw() : name(aName), size(aSize), parent(aDir), tthRoot(NULL), adls(false) { ! } File(const File& rhs, bool _adls = false) : name(rhs.name), size(rhs.size), parent(rhs.parent), tthRoot(rhs.tthRoot == NULL ? NULL : new TTHValue(*rhs.tthRoot)), adls(_adls) *************** *** 91,95 **** Directory(Directory* aParent, const string& aName, bool _adls, bool aComplete) ! : name(aName), parent(aParent), adls(_adls), complete(aComplete) { }; virtual ~Directory() { --- 91,95 ---- Directory(Directory* aParent, const string& aName, bool _adls, bool aComplete) ! : name(aName), parent(aParent), adls(_adls), complete(aComplete) { } virtual ~Directory() { *************** *** 104,108 **** void getHashList(HASH_SET<TTHValue, TTHValue::Hash>& l); ! size_t getFileCount() { return files.size(); }; int64_t getSize() { --- 104,108 ---- void getHashList(HASH_SET<TTHValue, TTHValue::Hash>& l); ! size_t getFileCount() { return files.size(); } int64_t getSize() { Index: HashManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/HashManager.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** HashManager.h 24 Dec 2005 23:13:25 -0000 1.32 --- HashManager.h 19 Feb 2006 16:19:06 -0000 1.33 *************** *** 197,201 **** const TTHValue* getTTH(const string& aFileName); bool getTree(const TTHValue& root, TigerTree& tth); ! bool isDirty() { return dirty; }; private: /** Root -> tree mapping info, we assume there's only one tree for each root (a collision would mean we've broken tiger...) */ --- 197,201 ---- const TTHValue* getTTH(const string& aFileName); bool getTree(const TTHValue& root, TigerTree& tth); ! bool isDirty() { return dirty; } private: /** Root -> tree mapping info, we assume there's only one tree for each root (a collision would mean we've broken tiger...) */ Index: User.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/User.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** User.h 17 Feb 2006 19:23:51 -0000 1.70 --- User.h 19 Feb 2006 16:19:06 -0000 1.71 *************** *** 72,76 **** User(const CID& aCID) : cid(aCID) { } ! virtual ~User() throw() { }; operator CID() { return cid; } --- 72,76 ---- User(const CID& aCID) : cid(aCID) { } ! virtual ~User() throw() { } operator CID() { return cid; } Index: MerkleTree.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/MerkleTree.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MerkleTree.h 24 Apr 2005 09:45:39 -0000 1.26 --- MerkleTree.h 19 Feb 2006 16:19:06 -0000 1.27 *************** *** 220,224 **** template<int64_t aBlockSize> struct TTFilter { ! TTFilter() : tt(aBlockSize) { }; void operator()(const void* data, size_t len) { tt.update(data, len); } TigerTree& getTree() { return tt; } --- 220,224 ---- template<int64_t aBlockSize> struct TTFilter { ! TTFilter() : tt(aBlockSize) { } void operator()(const void* data, size_t len) { tt.update(data, len); } TigerTree& getTree() { return tt; } Index: DirectoryListing.cpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/DirectoryListing.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** DirectoryListing.cpp 5 Feb 2006 17:02:38 -0000 1.57 --- DirectoryListing.cpp 19 Feb 2006 16:19:06 -0000 1.58 *************** *** 177,181 **** public: ListLoader(DirectoryListing::Directory* root, bool aUpdating) : cur(root), base("/"), inListing(false), updating(aUpdating) { ! }; virtual ~ListLoader() { } --- 177,181 ---- public: ListLoader(DirectoryListing::Directory* root, bool aUpdating) : cur(root), base("/"), inListing(false), updating(aUpdating) { ! } virtual ~ListLoader() { } Index: Speaker.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/Speaker.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Speaker.h 24 Apr 2005 08:13:36 -0000 1.9 --- Speaker.h 19 Feb 2006 16:19:06 -0000 1.10 *************** *** 32,37 **** public: ! Speaker() throw() { }; ! virtual ~Speaker() throw() { }; template<typename T0> --- 32,37 ---- public: ! Speaker() throw() { } ! virtual ~Speaker() throw() { } template<typename T0> Index: Thread.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/Thread.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Thread.h 24 Apr 2005 08:13:37 -0000 1.22 --- Thread.h 19 Feb 2006 16:19:06 -0000 1.23 *************** *** 48,56 **** }; ! Thread() throw() : threadHandle(NULL), threadId(0){ }; virtual ~Thread() { if(threadHandle) CloseHandle(threadHandle); ! }; void start() throw(ThreadException); --- 48,56 ---- }; ! Thread() throw() : threadHandle(NULL), threadId(0){ } virtual ~Thread() { if(threadHandle) CloseHandle(threadHandle); ! } void start() throw(ThreadException); *************** *** 65,75 **** } ! void setThreadPriority(Priority p) throw() { ::SetThreadPriority(threadHandle, p); }; ! static void sleep(u_int32_t millis) { ::Sleep(millis); }; ! static void yield() { ::Sleep(0); }; ! static long safeInc(volatile long& v) { return InterlockedIncrement(&v); }; ! static long safeDec(volatile long& v) { return InterlockedDecrement(&v); }; ! static long safeExchange(volatile long& target, long value) { return InterlockedExchange(&target, value); }; #else --- 65,75 ---- } ! void setThreadPriority(Priority p) throw() { ::SetThreadPriority(threadHandle, p); } ! static void sleep(u_int32_t millis) { ::Sleep(millis); } ! static void yield() { ::Sleep(0); } ! static long safeInc(volatile long& v) { return InterlockedIncrement(&v); } ! static long safeDec(volatile long& v) { return InterlockedDecrement(&v); } ! static long safeExchange(volatile long& target, long value) { return InterlockedExchange(&target, value); } #else *************** *** 81,90 **** HIGH = -1 }; ! Thread() throw() : threadHandle(0) { }; virtual ~Thread() { if(threadHandle != 0) { pthread_detach(threadHandle); } ! }; void start() throw(ThreadException); void join() throw() { --- 81,90 ---- HIGH = -1 }; ! Thread() throw() : threadHandle(0) { } virtual ~Thread() { if(threadHandle != 0) { pthread_detach(threadHandle); } ! } void start() throw(ThreadException); void join() throw() { *************** *** 93,101 **** threadHandle = 0; } ! }; ! void setThreadPriority(Priority p) { setpriority(PRIO_PROCESS, 0, p); }; ! static void sleep(u_int32_t millis) { ::usleep(millis*1000); }; ! static void yield() { ::sched_yield(); }; static long safeInc(volatile long& v) { #ifdef HAVE_ASM_ATOMIC_H --- 93,101 ---- threadHandle = 0; } ! } ! void setThreadPriority(Priority p) { setpriority(PRIO_PROCESS, 0, p); } ! static void sleep(u_int32_t millis) { ::usleep(millis*1000); } ! static void yield() { ::sched_yield(); } static long safeInc(volatile long& v) { #ifdef HAVE_ASM_ATOMIC_H *************** *** 107,111 **** return ++v; #endif ! }; static long safeDec(volatile long& v) { #ifdef HAVE_ASM_ATOMIC_H --- 107,111 ---- return ++v; #endif ! } static long safeDec(volatile long& v) { #ifdef HAVE_ASM_ATOMIC_H *************** *** 117,121 **** return --v; #endif ! }; #endif --- 117,121 ---- return --v; #endif ! } #endif Index: FavoriteManager.cpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/FavoriteManager.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** FavoriteManager.cpp 5 Feb 2006 13:38:44 -0000 1.17 --- FavoriteManager.cpp 19 Feb 2006 16:19:05 -0000 1.18 *************** *** 279,283 **** class XmlListLoader : public SimpleXMLReader::CallBack { public: ! XmlListLoader(HubEntry::List& lst) : publicHubs(lst) { }; virtual ~XmlListLoader() { } virtual void startTag(const string& name, StringPairList& attribs, bool) { --- 279,283 ---- class XmlListLoader : public SimpleXMLReader::CallBack { public: ! XmlListLoader(HubEntry::List& lst) : publicHubs(lst) { } virtual ~XmlListLoader() { } virtual void startTag(const string& name, StringPairList& attribs, bool) { Index: TimerManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/TimerManager.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TimerManager.h 12 Feb 2006 18:16:12 -0000 1.28 --- TimerManager.h 19 Feb 2006 16:19:06 -0000 1.29 *************** *** 64,68 **** return (u_int32_t)((tv2.tv_sec - tv.tv_sec) * 1000 ) + ( (tv2.tv_usec - tv.tv_usec) / 1000); #endif ! }; private: --- 64,68 ---- return (u_int32_t)((tv2.tv_sec - tv.tv_sec) * 1000 ) + ( (tv2.tv_usec - tv.tv_usec) / 1000); #endif ! } private: *************** *** 74,83 **** gettimeofday(&tv, NULL); #endif ! }; virtual ~TimerManager() throw() { dcassert(listeners.empty()); shutdown(); ! }; virtual int run(); --- 74,83 ---- gettimeofday(&tv, NULL); #endif ! } virtual ~TimerManager() throw() { dcassert(listeners.empty()); shutdown(); ! } virtual int run(); Index: UploadManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/UploadManager.h,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** UploadManager.h 29 Jan 2006 18:48:25 -0000 1.84 --- UploadManager.h 19 Feb 2006 16:19:06 -0000 1.85 *************** *** 45,55 **** typedef List::iterator Iter; ! Upload() : tth(NULL), file(NULL) { }; virtual ~Upload() { delete file; delete tth; ! }; ! User::Ptr& getUser() { dcassert(getUserConnection() != NULL); return getUserConnection()->getUser(); }; GETSET(string, fileName, FileName); --- 45,55 ---- typedef List::iterator Iter; ! Upload() : tth(NULL), file(NULL) { } virtual ~Upload() { delete file; delete tth; ! } ! User::Ptr& getUser() { dcassert(getUserConnection() != NULL); return getUserConnection()->getUser(); } GETSET(string, fileName, FileName); *************** *** 70,79 **** typedef X<5> WaitingRemoveUser; ! virtual void on(Starting, Upload*) throw() { }; ! virtual void on(Tick, const Upload::List&) throw() { }; ! virtual void on(Complete, Upload*) throw() { }; ! virtual void on(Failed, Upload*, const string&) throw() { }; ! virtual void on(WaitingAddFile, const User::Ptr, const string&) throw() { }; ! virtual void on(WaitingRemoveUser, const User::Ptr) throw() { }; }; --- 70,79 ---- typedef X<5> WaitingRemoveUser; ! virtual void on(Starting, Upload*) throw() { } ! virtual void on(Tick, const Upload::List&) throw() { } ! virtual void on(Complete, Upload*) throw() { } ! virtual void on(Failed, Upload*, const string&) throw() { } ! virtual void on(WaitingAddFile, const User::Ptr, const string&) throw() { } ! virtual void on(WaitingRemoveUser, const User::Ptr) throw() { } }; *************** *** 84,88 **** /** @return Number of uploads. */ ! size_t getUploadCount() { Lock l(cs); return uploads.size(); }; /** --- 84,88 ---- /** @return Number of uploads. */ ! size_t getUploadCount() { Lock l(cs); return uploads.size(); } /** *************** *** 118,122 **** /** @internal */ ! int getFreeExtraSlots() { return max(3 - getExtra(), 0); }; /** @param aUser Reserve an upload slot for this user and connect. */ --- 118,122 ---- /** @internal */ ! int getFreeExtraSlots() { return max(3 - getExtra(), 0); } /** @param aUser Reserve an upload slot for this user and connect. */ Index: UserConnection.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/UserConnection.h,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** UserConnection.h 12 Feb 2006 18:16:12 -0000 1.105 --- UserConnection.h 19 Feb 2006 16:19:06 -0000 1.106 *************** *** 97,121 **** public: Transfer() : userConnection(NULL), start(0), lastTick(GET_TICK()), runningAverage(0), ! last(0), actual(0), pos(0), startPos(0), size(-1) { }; ! virtual ~Transfer() { }; ! int64_t getPos() const { return pos; }; ! void setPos(int64_t aPos) { pos = aPos; }; ! void resetPos() { pos = getStartPos(); }; ! void setStartPos(int64_t aPos) { startPos = aPos; pos = aPos; }; int64_t getStartPos() const { return startPos; } ! void addPos(int64_t aBytes, int64_t aActual) { pos += aBytes; actual+= aActual; }; enum { AVG_PERIOD = 30000 }; void updateRunningAverage(); ! int64_t getTotal() const { return getPos() - getStartPos(); }; ! int64_t getActual() const { return actual; }; ! int64_t getSize() const { return size; }; ! void setSize(int64_t aSize) { size = aSize; }; ! void setSize(const string& aSize) { setSize(Util::toInt64(aSize)); }; int64_t getAverageSpeed() const { --- 97,121 ---- public: Transfer() : userConnection(NULL), start(0), lastTick(GET_TICK()), runningAverage(0), ! last(0), actual(0), pos(0), startPos(0), size(-1) { } ! virtual ~Transfer() { } ! int64_t getPos() const { return pos; } ! void setPos(int64_t aPos) { pos = aPos; } ! void resetPos() { pos = getStartPos(); } ! void setStartPos(int64_t aPos) { startPos = aPos; pos = aPos; } int64_t getStartPos() const { return startPos; } ! void addPos(int64_t aBytes, int64_t aActual) { pos += aBytes; actual+= aActual; } enum { AVG_PERIOD = 30000 }; void updateRunningAverage(); ! int64_t getTotal() const { return getPos() - getStartPos(); } ! int64_t getActual() const { return actual; } ! int64_t getSize() const { return size; } ! void setSize(int64_t aSize) { size = aSize; } ! void setSize(const string& aSize) { setSize(Util::toInt64(aSize)); } int64_t getAverageSpeed() const { *************** *** 226,230 **** }; ! short getNumber() { return (short)((((size_t)this)>>2) & 0x7fff); }; // NMDC stuff --- 226,230 ---- }; ! short getNumber() { return (short)((((size_t)this)>>2) & 0x7fff); } // NMDC stuff *************** *** 233,245 **** void key(const string& aKey) { send("$Key " + aKey + '|'); } void direction(const string& aDirection, int aNumber) { send("$Direction " + aDirection + " " + Util::toString(aNumber) + '|'); } ! void get(const string& aFile, int64_t aResume) { send("$Get " + aFile + "$" + Util::toString(aResume + 1) + '|'); }; // No acp - utf conversion here... ! void getZBlock(const string& aFile, int64_t aResume, int64_t aBytes, bool utf8) { send((utf8 ? "$UGetZBlock " : "$GetZBlock ") + Util::toString(aResume) + ' ' + Util::toString(aBytes) + ' ' + aFile + '|'); }; void uGetBlock(const string& aFile, int64_t aResume, int64_t aBytes) { send("$UGetBlock " + Util::toString(aResume) + ' ' + Util::toString(aBytes) + ' ' + aFile + '|'); } void fileLength(const string& aLength) { send("$FileLength " + aLength + '|'); } void startSend() { send("$Send|"); } ! void sending(int64_t bytes) { send(bytes == -1 ? string("$Sending|") : "$Sending " + Util::toString(bytes) + "|"); }; ! void error(const string& aError) { send("$Error " + aError + '|'); }; ! void listLen(const string& aLength) { send("$ListLen " + aLength + '|'); }; ! void maxedOut() { isSet(FLAG_NMDC) ? send("$MaxedOut|") : send(AdcCommand(AdcCommand::SEV_RECOVERABLE, AdcCommand::ERROR_SLOTS_FULL, "Slots full")); }; void fileNotAvail() { isSet(FLAG_NMDC) ? send("$Error " + FILE_NOT_AVAILABLE + "|") : send(AdcCommand(AdcCommand::SEV_RECOVERABLE, AdcCommand::ERROR_FILE_NOT_AVAILABLE, FILE_NOT_AVAILABLE)); } --- 233,245 ---- void key(const string& aKey) { send("$Key " + aKey + '|'); } void direction(const string& aDirection, int aNumber) { send("$Direction " + aDirection + " " + Util::toString(aNumber) + '|'); } ! void get(const string& aFile, int64_t aResume) { send("$Get " + aFile + "$" + Util::toString(aResume + 1) + '|'); } // No acp - utf conversion here... ! void getZBlock(const string& aFile, int64_t aResume, int64_t aBytes, bool utf8) { send((utf8 ? "$UGetZBlock " : "$GetZBlock ") + Util::toString(aResume) + ' ' + Util::toString(aBytes) + ' ' + aFile + '|'); } void uGetBlock(const string& aFile, int64_t aResume, int64_t aBytes) { send("$UGetBlock " + Util::toString(aResume) + ' ' + Util::toString(aBytes) + ' ' + aFile + '|'); } void fileLength(const string& aLength) { send("$FileLength " + aLength + '|'); } void startSend() { send("$Send|"); } ! void sending(int64_t bytes) { send(bytes == -1 ? string("$Sending|") : "$Sending " + Util::toString(bytes) + "|"); } ! void error(const string& aError) { send("$Error " + aError + '|'); } ! void listLen(const string& aLength) { send("$ListLen " + aLength + '|'); } ! void maxedOut() { isSet(FLAG_NMDC) ? send("$MaxedOut|") : send(AdcCommand(AdcCommand::SEV_RECOVERABLE, AdcCommand::ERROR_SLOTS_FULL, "Slots full")); } void fileNotAvail() { isSet(FLAG_NMDC) ? send("$Error " + FILE_NOT_AVAILABLE + "|") : send(AdcCommand(AdcCommand::SEV_RECOVERABLE, AdcCommand::ERROR_FILE_NOT_AVAILABLE, FILE_NOT_AVAILABLE)); } *************** *** 318,326 **** UserConnection(bool secure_) throw() : /*cqi(NULL),*/ state(STATE_UNCONNECTED), lastActivity(0), socket(0), secure(secure_), download(NULL) { ! }; virtual ~UserConnection() throw() { BufferedSocket::putSocket(socket); ! }; friend struct DeleteFunction; --- 318,326 ---- UserConnection(bool secure_) throw() : /*cqi(NULL),*/ state(STATE_UNCONNECTED), lastActivity(0), socket(0), secure(secure_), download(NULL) { ! } virtual ~UserConnection() throw() { BufferedSocket::putSocket(socket); ! } friend struct DeleteFunction; *************** *** 330,334 **** void setUser(const User::Ptr& aUser) { user = aUser; ! }; void onLine(const string& aLine) throw(); --- 330,334 ---- void setUser(const User::Ptr& aUser) { user = aUser; ! } void onLine(const string& aLine) throw(); Index: LogManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/LogManager.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** LogManager.h 26 Dec 2005 17:16:03 -0000 1.20 --- LogManager.h 19 Feb 2006 16:19:05 -0000 1.21 *************** *** 34,38 **** typedef X<0> Message; ! virtual void on(Message, time_t, const string&) throw() { }; }; --- 34,38 ---- typedef X<0> Message; ! virtual void on(Message, time_t, const string&) throw() { } }; *************** *** 113,118 **** logOptions[STATUS][FILE] = SettingsManager::LOG_FILE_STATUS; logOptions[STATUS][FORMAT] = SettingsManager::LOG_FORMAT_STATUS; ! }; ! virtual ~LogManager() throw() { }; }; --- 113,118 ---- logOptions[STATUS][FILE] = SettingsManager::LOG_FILE_STATUS; logOptions[STATUS][FORMAT] = SettingsManager::LOG_FORMAT_STATUS; ! } ! virtual ~LogManager() throw() { } }; Index: Makefile.am =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.am 17 Feb 2006 19:23:51 -0000 1.9 --- Makefile.am 19 Feb 2006 16:19:06 -0000 1.10 *************** *** 5,11 **** LIBDCPP_AGE=0 ! libdcppclient_la_LDFLAGS = -export-dynamic -version-info $(LIBDCPP_CURRENT):$(LIBDCPP_REVISION):$(LIBDCPP_AGE) ! libdcppclient_la_CXXFLAGS = -Wall -pedantic -ansi -Wno-long-long -I$(top_srcdir)/yassl/include libdcppclient_la_SOURCES= \ --- 5,11 ---- LIBDCPP_AGE=0 ! libdcppclient_la_LDFLAGS = -no-undefined -export-dynamic -version-info $(LIBDCPP_CURRENT):$(LIBDCPP_REVISION):$(LIBDCPP_AGE) ! libdcppclient_la_CXXFLAGS = -Wall -Winvalid-pch -pedantic -ansi -Wno-long-long -I$(top_srcdir)/yassl/include libdcppclient_la_SOURCES= \ *************** *** 126,129 **** stdinc.h.gch: stdinc.h ! $(CXX) $(libdcppclient_la_CXXFLAGS) $(CXXFLAGS) $? --- 126,129 ---- stdinc.h.gch: stdinc.h ! $(CXXCOMPILE) $? Index: BitInputStream.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/BitInputStream.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** BitInputStream.h 24 Apr 2005 08:13:11 -0000 1.17 --- BitInputStream.h 19 Feb 2006 16:19:06 -0000 1.18 *************** *** 36,41 **** { public: ! BitInputStream(const u_int8_t* aStream, size_t aStart, size_t aEnd) : bitPos(aStart*8), endPos(aEnd*8), is(aStream) { }; ! ~BitInputStream() { }; bool get() throw(BitStreamException) { --- 36,41 ---- { public: ! BitInputStream(const u_int8_t* aStream, size_t aStart, size_t aEnd) : bitPos(aStart*8), endPos(aEnd*8), is(aStream) { } ! ~BitInputStream() { } bool get() throw(BitStreamException) { Index: ShareManager.cpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/ShareManager.cpp,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** ShareManager.cpp 13 Feb 2006 21:13:27 -0000 1.144 --- ShareManager.cpp 19 Feb 2006 16:19:06 -0000 1.145 *************** *** 45,50 **** ShareManager::ShareManager() : hits(0), listLen(0), bzXmlListLen(0), ! xmlDirty(true), nmdcDirty(false), refreshDirs(false), update(false), initial(true), listN(0), lFile(NULL), ! xFile(NULL), lastXmlUpdate(0), lastNmdcUpdate(0), lastFullUpdate(GET_TICK()), bloom(1<<20), refreshing(0) { SettingsManager::getInstance()->addListener(this); --- 45,50 ---- ShareManager::ShareManager() : hits(0), listLen(0), bzXmlListLen(0), ! xmlDirty(true), nmdcDirty(false), refreshDirs(false), update(false), initial(true), listN(0), refreshing(0), lFile(NULL), ! xFile(NULL), lastXmlUpdate(0), lastNmdcUpdate(0), lastFullUpdate(GET_TICK()), bloom(1<<20) { SettingsManager::getInstance()->addListener(this); Index: ServerSocket.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/ServerSocket.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ServerSocket.h 16 Dec 2005 01:00:46 -0000 1.27 --- ServerSocket.h 19 Feb 2006 16:19:06 -0000 1.28 *************** *** 37,41 **** class ServerSocket : public Speaker<ServerSocketListener> { public: ! ServerSocket() throw() { }; void listen(short port) throw(SocketException); --- 37,41 ---- class ServerSocket : public Speaker<ServerSocketListener> { public: ! ServerSocket() throw() { } void listen(short port) throw(SocketException); Index: Semaphore.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/Semaphore.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Semaphore.h 24 Apr 2005 08:13:11 -0000 1.14 --- Semaphore.h 19 Feb 2006 16:19:06 -0000 1.15 *************** *** 35,39 **** Semaphore() throw() { h = CreateSemaphore(NULL, 0, MAXLONG, NULL); ! }; void signal() throw() { --- 35,39 ---- Semaphore() throw() { h = CreateSemaphore(NULL, 0, MAXLONG, NULL); ! } void signal() throw() { *************** *** 41,50 **** } ! bool wait() throw() { return WaitForSingleObject(h, INFINITE) == WAIT_OBJECT_0; }; ! bool wait(u_int32_t millis) throw() { return WaitForSingleObject(h, millis) == WAIT_OBJECT_0; }; ~Semaphore() throw() { CloseHandle(h); ! }; private: --- 41,50 ---- } ! bool wait() throw() { return WaitForSingleObject(h, INFINITE) == WAIT_OBJECT_0; } ! bool wait(u_int32_t millis) throw() { return WaitForSingleObject(h, millis) == WAIT_OBJECT_0; } ~Semaphore() throw() { CloseHandle(h); ! } private: *************** *** 52,62 **** #else public: ! Semaphore() throw() : count(0) { pthread_cond_init(&cond, NULL); }; ! ~Semaphore() throw() { pthread_cond_destroy(&cond); }; void signal() throw() { Lock l(cs); count++; pthread_cond_signal(&cond); ! }; bool wait() throw() { --- 52,62 ---- #else public: ! Semaphore() throw() : count(0) { pthread_cond_init(&cond, NULL); } ! ~Semaphore() throw() { pthread_cond_destroy(&cond); } void signal() throw() { Lock l(cs); count++; pthread_cond_signal(&cond); ! } bool wait() throw() { *************** *** 67,71 **** count--; return true; ! }; bool wait(u_int32_t millis) throw() { Lock l(cs); --- 67,71 ---- count--; return true; ! } bool wait(u_int32_t millis) throw() { Lock l(cs); *************** *** 84,88 **** count--; return true; ! }; private: --- 84,88 ---- count--; return true; ! } private: Index: CryptoManager.cpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/CryptoManager.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** CryptoManager.cpp 24 Apr 2005 09:45:39 -0000 1.55 --- CryptoManager.cpp 19 Feb 2006 16:19:06 -0000 1.56 *************** *** 306,310 **** bool operator() (const Node* a, const Node* b) const { return *a < *b; ! }; }; --- 306,310 ---- bool operator() (const Node* a, const Node* b) const { return *a < *b; ! } }; Index: QueueManager.cpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/QueueManager.cpp,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** QueueManager.cpp 10 Feb 2006 07:56:46 -0000 1.145 --- QueueManager.cpp 19 Feb 2006 16:19:06 -0000 1.146 *************** *** 1182,1186 **** class QueueLoader : public SimpleXMLReader::CallBack { public: ! QueueLoader() : cur(NULL), inDownloads(false) { }; virtual ~QueueLoader() { } virtual void startTag(const string& name, StringPairList& attribs, bool simple); --- 1182,1186 ---- class QueueLoader : public SimpleXMLReader::CallBack { public: ! QueueLoader() : cur(NULL), inDownloads(false) { } virtual ~QueueLoader() { } virtual void startTag(const string& name, StringPairList& attribs, bool simple); Index: ResourceManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/ResourceManager.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ResourceManager.h 5 Jan 2006 00:11:31 -0000 1.16 --- ResourceManager.h 19 Feb 2006 16:19:06 -0000 1.17 *************** *** 32,37 **** void loadLanguage(const string& aFile); ! const string& getString(Strings x) const { dcassert(x >= 0 && x < LAST); return strings[x]; }; ! const wstring& getStringW(Strings x) const { dcassert(x >= 0 && x < LAST); return wstrings[x]; }; bool isRTL() { return rtl; } private: --- 32,37 ---- void loadLanguage(const string& aFile); ! const string& getString(Strings x) const { dcassert(x >= 0 && x < LAST); return strings[x]; } ! const wstring& getStringW(Strings x) const { dcassert(x >= 0 && x < LAST); return wstrings[x]; } bool isRTL() { return rtl; } private: *************** *** 43,49 **** ResourceManager() : rtl(false) { createWide(); ! }; ! virtual ~ResourceManager() { }; static string strings[LAST]; --- 43,49 ---- ResourceManager() : rtl(false) { createWide(); ! } ! virtual ~ResourceManager() { } static string strings[LAST]; Index: StringSearch.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/StringSearch.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StringSearch.h 24 Apr 2005 08:13:11 -0000 1.9 --- StringSearch.h 19 Feb 2006 16:19:06 -0000 1.10 *************** *** 40,47 **** explicit StringSearch(const string& aPattern) throw() : pattern(Text::toLower(aPattern)) { initDelta1(); ! }; StringSearch(const StringSearch& rhs) throw() : pattern(rhs.pattern) { memcpy(delta1, rhs.delta1, sizeof(delta1)); ! }; const StringSearch& operator=(const StringSearch& rhs) { memcpy(delta1, rhs.delta1, sizeof(delta1)); --- 40,47 ---- explicit StringSearch(const string& aPattern) throw() : pattern(Text::toLower(aPattern)) { initDelta1(); ! } StringSearch(const StringSearch& rhs) throw() : pattern(rhs.pattern) { memcpy(delta1, rhs.delta1, sizeof(delta1)); ! } const StringSearch& operator=(const StringSearch& rhs) { memcpy(delta1, rhs.delta1, sizeof(delta1)); *************** *** 55,61 **** } ! bool operator==(const StringSearch& rhs) { return pattern == rhs.pattern; }; ! const string& getPattern() const { return pattern; }; /** Match a text against the pattern */ --- 55,61 ---- } ! bool operator==(const StringSearch& rhs) { return pattern == rhs.pattern; } ! const string& getPattern() const { return pattern; } /** Match a text against the pattern */ Index: ConnectionManagerListener.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/ConnectionManagerListener.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConnectionManagerListener.h 24 Apr 2005 08:13:11 -0000 1.6 --- ConnectionManagerListener.h 19 Feb 2006 16:19:06 -0000 1.7 *************** *** 36,44 **** typedef X<4> StatusChanged; ! virtual void on(Added, ConnectionQueueItem*) throw() { }; ! virtual void on(Connected, ConnectionQueueItem*) throw() { }; ! virtual void on(Removed, ConnectionQueueItem*) throw() { }; ! virtual void on(Failed, ConnectionQueueItem*, const string&) throw() { }; ! virtual void on(StatusChanged, ConnectionQueueItem*) throw() { }; }; --- 36,44 ---- typedef X<4> StatusChanged; ! virtual void on(Added, ConnectionQueueItem*) throw() { } ! virtual void on(Connected, ConnectionQueueItem*) throw() { } ! virtual void on(Removed, ConnectionQueueItem*) throw() { } ! virtual void on(Failed, ConnectionQueueItem*, const string&) throw() { } ! virtual void on(StatusChanged, ConnectionQueueItem*) throw() { } }; Index: ShareManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/ShareManager.h,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** ShareManager.h 10 Feb 2006 07:56:46 -0000 1.86 --- ShareManager.h 19 Feb 2006 16:19:06 -0000 1.87 *************** *** 62,66 **** bool getTTH(const string& aFile, TTHValue& tth) throw(); void refresh(bool dirs = false, bool aUpdate = true, bool block = false) throw(ThreadException, ShareException); ! void setDirty() { xmlDirty = nmdcDirty = true; }; void search(SearchResult::List& l, const string& aString, int aSearchType, int64_t aSize, int aFileType, Client* aClient, StringList::size_type maxResults); --- 62,66 ---- bool getTTH(const string& aFile, TTHValue& tth) throw(); void refresh(bool dirs = false, bool aUpdate = true, bool block = false) throw(ThreadException, ShareException); ! void setDirty() { xmlDirty = nmdcDirty = true; } void search(SearchResult::List& l, const string& aString, int aSearchType, int64_t aSize, int aFileType, Client* aClient, StringList::size_type maxResults); *************** *** 79,87 **** size_t getSharedFiles() throw(); ! string getShareSizeString() { return Util::toString(getShareSize()); }; ! string getShareSizeString(const string& aDir) { return Util::toString(getShareSize(aDir)); }; ! int64_t getListLen() { return generateNmdcList(), listLen; }; ! string getListLenString() { return Util::toString(getListLen()); }; SearchManager::TypeModes getType(const string& fileName); --- 79,87 ---- size_t getSharedFiles() throw(); ! string getShareSizeString() { return Util::toString(getShareSize()); } ! string getShareSizeString(const string& aDir) { return Util::toString(getShareSize(aDir)); } ! int64_t getListLen() { return generateNmdcList(), listLen; } ! string getListLenString() { return Util::toString(getListLen()); } SearchManager::TypeModes getType(const string& fileName); *************** *** 125,133 **** typedef Set::iterator Iter; ! File() : size(0), parent(NULL) { }; File(const string& aName, int64_t aSize, Directory* aParent, const TTHValue& aRoot) : ! name(aName), tth(aRoot), size(aSize), parent(aParent) { }; File(const File& rhs) : ! name(rhs.getName()), tth(rhs.getTTH()), size(rhs.getSize()), parent(rhs.getParent()) { }; ~File() { } --- 125,133 ---- typedef Set::iterator Iter; ! File() : size(0), parent(NULL) { } File(const string& aName, int64_t aSize, Directory* aParent, const TTHValue& aRoot) : ! name(aName), tth(aRoot), size(aSize), parent(aParent) { } File(const File& rhs) : ! name(rhs.getName()), tth(rhs.getTTH()), size(rhs.getSize()), parent(rhs.getParent()) { } ~File() { } *************** *** 161,165 **** Directory(const string& aName = Util::emptyString, Directory* aParent = NULL) : size(0), name(aName), parent(aParent), fileTypes(0) { ! }; ~Directory(); --- 161,165 ---- Directory(const string& aName = Util::emptyString, Directory* aParent = NULL) : size(0), name(aName), parent(aParent), fileTypes(0) { ! } ~Directory(); Index: FavoriteManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/FavoriteManager.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FavoriteManager.h 1 Jan 2006 22:42:54 -0000 1.11 --- FavoriteManager.h 19 Feb 2006 16:19:06 -0000 1.12 *************** *** 42,46 **** HubEntry(const string& aName, const string& aServer, const string& aDescription, const string& aUsers) throw() : name(aName), server(aServer), description(aDescription), country(Util::emptyString), ! rating(Util::emptyString), reliability(0.0), shared(0), minShare(0), users(Util::toInt(aUsers)), minSlots(0), maxHubs(0), maxUsers(0) { }; HubEntry(const string& aName, const string& aServer, const string& aDescription, const string& aUsers, const string& aCountry, --- 42,46 ---- HubEntry(const string& aName, const string& aServer, const string& aDescription, const string& aUsers) throw() : name(aName), server(aServer), description(aDescription), country(Util::emptyString), ! rating(Util::emptyString), reliability(0.0), shared(0), minShare(0), users(Util::toInt(aUsers)), minSlots(0), maxHubs(0), maxUsers(0) { } HubEntry(const string& aName, const string& aServer, const string& aDescription, const string& aUsers, const string& aCountry, *************** *** 53,62 **** } ! HubEntry() throw() { }; HubEntry(const HubEntry& rhs) throw() : name(rhs.name), server(rhs.server), description(rhs.description), country(rhs.country), rating(rhs.rating), reliability(rhs.reliability), shared(rhs.shared), minShare(rhs.minShare), users(rhs.users), minSlots(rhs.minSlots), maxHubs(rhs.maxHubs), maxUsers(rhs.maxUsers) { } ! ~HubEntry() throw() { }; GETSET(string, name, Name); --- 53,62 ---- } ! HubEntry() throw() { } HubEntry(const HubEntry& rhs) throw() : name(rhs.name), server(rhs.server), description(rhs.description), country(rhs.country), rating(rhs.rating), reliability(rhs.reliability), shared(rhs.shared), minShare(rhs.minShare), users(rhs.users), minSlots(rhs.minSlots), maxHubs(rhs.maxHubs), maxUsers(rhs.maxUsers) { } ! ~HubEntry() throw() { } GETSET(string, name, Name); *************** *** 80,87 **** typedef List::iterator Iter; ! FavoriteHubEntry() throw() : connect(false), bottom(0), top(0), left(0), right(0){ }; ! FavoriteHubEntry(const HubEntry& rhs) throw() : name(rhs.getName()), server(rhs.getServer()), description(rhs.getDescription()), connect(false), bottom(0), top(0), left(0), right(0){ }; FavoriteHubEntry(const FavoriteHubEntry& rhs) throw() : userdescription(rhs.userdescription), name(rhs.getName()), server(rhs.getServer()), description(rhs.getDescription()), ! password(rhs.getPassword()), connect(rhs.getConnect()), bottom(rhs.getBottom()), top(rhs.getTop()), left(rhs.getLeft()), right(rhs.getRight()), nick(rhs.nick){ }; ~FavoriteHubEntry() throw() { } --- 80,87 ---- typedef List::iterator Iter; ! FavoriteHubEntry() throw() : connect(false), bottom(0), top(0), left(0), right(0){ } ! FavoriteHubEntry(const HubEntry& rhs) throw() : name(rhs.getName()), server(rhs.getServer()), description(rhs.getDescription()), connect(false), bottom(0), top(0), left(0), right(0){ } FavoriteHubEntry(const FavoriteHubEntry& rhs) throw() : userdescription(rhs.userdescription), name(rhs.getName()), server(rhs.getServer()), description(rhs.getDescription()), ! password(rhs.getPassword()), connect(rhs.getConnect()), bottom(rhs.getBottom()), top(rhs.getTop()), left(rhs.getLeft()), right(rhs.getRight()), nick(rhs.nick){ } ~FavoriteHubEntry() throw() { } *************** *** 90,94 **** } ! void setNick(const string& aNick) { nick = aNick; }; GETSET(string, userdescription, UserDescription); --- 90,94 ---- } ! void setNick(const string& aNick) { nick = aNick; } GETSET(string, userdescription, UserDescription); *************** *** 148,163 **** StringList getHubLists(); bool setHubList(int /*aHubList*/); ! int getSelectedHubList() { return lastServer; }; void refresh(); ! HubTypes getHubListType() { return listType; }; HubEntry::List getPublicHubs() { Lock l(cs); return publicListMatrix[publicListServer]; } ! bool isDownloading() { return running; }; // Favorite Users typedef HASH_MAP_X(CID, FavoriteUser, CID::Hash, equal_to<CID>, less<CID>) FavoriteMap; ! FavoriteMap getFavoriteUsers() { Lock l(cs); return users; }; void addFavoriteUser(User::Ptr& aUser); --- 148,163 ---- StringList getHubLists(); bool setHubList(int /*aHubList*/); ! int getSelectedHubList() { return lastServer; } void refresh(); ! HubTypes getHubListType() { return listType; } HubEntry::List getPublicHubs() { Lock l(cs); return publicListMatrix[publicListServer]; } ! bool isDownloading() { return running; } // Favorite Users typedef HASH_MAP_X(CID, FavoriteUser, CID::Hash, equal_to<CID>, less<CID>) FavoriteMap; ! FavoriteMap getFavoriteUsers() { Lock l(cs); return users; } void addFavoriteUser(User::Ptr& aUser); *************** *** 171,175 **** time_t getLastSeen(const User::Ptr& aUser) const; // Favorite Hubs ! FavoriteHubEntry::List& getFavoriteHubs() { return favoriteHubs; }; void addFavorite(const FavoriteHubEntry& aEntry); --- 171,175 ---- time_t getLastSeen(const User::Ptr& aUser) const; // Favorite Hubs ! FavoriteHubEntry::List& getFavoriteHubs() { return favoriteHubs; } void addFavorite(const FavoriteHubEntry& aEntry); *************** *** 194,198 **** void removeHubUserCommands(int ctx, const string& hub); ! UserCommand::List getUserCommands() { Lock l(cs); return userCommands; }; UserCommand::List getUserCommands(int ctx, const StringList& hub); --- 194,198 ---- void removeHubUserCommands(int ctx, const string& hub); ! UserCommand::List getUserCommands() { Lock l(cs); return userCommands; } UserCommand::List getUserCommands(int ctx, const StringList& hub); Index: SearchManager.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/SearchManager.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** SearchManager.h 29 Jan 2006 18:48:25 -0000 1.58 --- SearchManager.h 19 Feb 2006 16:19:06 -0000 1.59 *************** *** 83,87 **** if(Thread::safeDec(ref) == 0) delete this; ! }; private: --- 83,87 ---- if(Thread::safeDec(ref) == 0) delete this; ! } private: *************** *** 89,93 **** SearchResult(); ! ~SearchResult() { delete tth; }; SearchResult(const SearchResult& rhs); --- 89,93 ---- SearchResult(); ! ~SearchResult() { delete tth; } SearchResult(const SearchResult& rhs); *************** *** 169,173 **** friend class Singleton<SearchManager>; ! SearchManager() : socket(NULL), port(0), stop(false), lastSearch(0) { }; virtual int run(); --- 169,173 ---- friend class Singleton<SearchManager>; ! SearchManager() : socket(NULL), port(0), stop(false), lastSearch(0) { } virtual int run(); *************** *** 182,186 **** delete socket; } ! }; void onData(const u_int8_t* buf, size_t aLen, const string& address); --- 182,186 ---- delete socket; } ! } void onData(const u_int8_t* buf, size_t aLen, const string& address); Index: DownloadManager.cpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/DownloadManager.cpp,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** DownloadManager.cpp 21 Jan 2006 09:23:55 -0000 1.159 --- DownloadManager.cpp 19 Feb 2006 16:19:06 -0000 1.160 *************** *** 409,413 **** class RollbackException : public FileException { public: ! RollbackException (const string& aError) : FileException(aError) { }; }; --- 409,413 ---- class RollbackException : public FileException { public: ! RollbackException (const string& aError) : FileException(aError) { } }; *************** *** 420,424 **** f->movePos(-((int64_t)bytes)); } ! virtual ~RollbackOutputStream() throw() { delete[] buf; if(managed) delete s; }; virtual size_t flush() throw(FileException) { --- 420,424 ---- f->movePos(-((int64_t)bytes)); } ! virtual ~RollbackOutputStream() throw() { delete[] buf; if(managed) delete s; } virtual size_t flush() throw(FileException) { Index: Socket.h =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/client/Socket.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Socket.h 24 Dec 2005 23:13:25 -0000 1.66 --- Socket.h 19 Feb 2006 16:19:06 -0000 1.67... [truncated message content] |