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 **** publ... [truncated message content] |