From: <arn...@us...> - 2006-02-26 21:20:15
|
Revision: 582 Author: arnetheduck Date: 2006-02-26 13:19:47 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=582&view=rev Log Message: ----------- Lots of small fixes Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.rc dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/Client.cpp dcplusplus/trunk/client/Client.h dcplusplus/trunk/client/CriticalSection.h dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/Thread.h dcplusplus/trunk/client/version.h dcplusplus/trunk/help/changelog.html dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h Property Changed: ---------------- dcplusplus/trunk/ dcplusplus/trunk/stlport/ dcplusplus/trunk/wtl/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: svn:ignore + vc7 ADC* App* Modified: dcplusplus/trunk/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/DCPlusPlus.rc 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/DCPlusPlus.rc 2006-02-26 21:19:47 UTC (rev 582) @@ -933,8 +933,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,8,6 - PRODUCTVERSION 0,6,8,6 + FILEVERSION 0,6,8,7 + PRODUCTVERSION 0,6,8,7 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -951,12 +951,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 6, 8, 6" + VALUE "FileVersion", "0, 6, 8, 7" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 6, 8, 6" + VALUE "ProductVersion", "0, 6, 8, 7" END END BLOCK "VarFileInfo" Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/Example.xml 2006-02-26 21:19:47 UTC (rev 582) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.686" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.687" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> @@ -363,6 +363,7 @@ <String Name="SettingsAntiFrag">Use antifragmentation method for downloads</String> <String Name="SettingsAppearance">Appearance</String> <String Name="SettingsAppearance2">Appearance\Colors and sounds</String> + <String Name="SettingsAutodropAutodropsettings">Autodrop settings</String> <String Name="SettingsAutodropSpeed">Drop sources below</String> <String Name="SettingsAutodropInterval">Check every</String> <String Name="SettingsAutodropElapsed">Min elapsed</String> @@ -445,6 +446,7 @@ <String Name="SettingsOpenNewWindow">Open new window when using /join</String> <String Name="SettingsOpenUserCmdHelp">Always open help file with this dialog</String> <String Name="SettingsOptions">Options</String> + <String Name="SettingsOtherQueueOptions">Other queue options</String> <String Name="SettingsOutgoing">Outgoing connection settings</String> <String Name="SettingsOverride">Don't allow hub/UPnP to override</String> <String Name="SettingsPersonalInformation">Personal Information</String> @@ -472,7 +474,7 @@ <String Name="SettingsShareSize">Total size:</String> <String Name="SettingsSharedDirectories">Shared directories</String> <String Name="SettingsShowJoins">Show joins / parts in chat by default</String> - <String Name="SettingsShowProgressBars">Show progress bars for transfers (uses some CPU)</String> + <String Name="SettingsShowProgressBars">Show progress bars for transfers</String> <String Name="SettingsSkipZeroByte">Skip zero-byte files</String> <String Name="SettingsSmallSendBuffer">Use small send buffer (enable if uploads slow downloads a lot)</String> <String Name="SettingsSocks5">SOCKS5</String> @@ -485,6 +487,7 @@ <String Name="SettingsStatusInChat">View status messages in main chat</String> <String Name="SettingsTcpPort">TCP Port</String> <String Name="SettingsTextMinislot">Mini slot size</String> + <String Name="SettingsPrioAutoprio">Autoprio settings</String> <String Name="SettingsPrioHighest">Highest prio max size</String> <String Name="SettingsPrioHigh">High prio max size</String> <String Name="SettingsPrioNormal">Normal prio max size</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/changelog.txt 2006-02-26 21:19:47 UTC (rev 582) @@ -10,7 +10,8 @@ * Added possiblity to sort transfer view by all downloads first (thanks guitarm) * Some cleanup for frame creation (thanks martin) * Fixed some translation strings (thanks fleetcommand) -* Fixed some finished transfer frame issues (thanks trem) +* Fixed some finished transfers frames issues (thanks trem) +* /pm and and a few other things work without user list in hub frame -- 0.686 2006-02-13 -- * Fixed active search (oops) Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -54,9 +54,13 @@ SIDIter i = users.find(aSID); if(i != users.end()) return *i->second; + } - User::Ptr p = ClientManager::getInstance()->getUser(aCID); + User::Ptr p = ClientManager::getInstance()->getUser(aCID); + + { + Lock l(cs); u = users.insert(make_pair(aSID, new OnlineUser(p, *this, aSID))).first->second; } @@ -145,7 +149,7 @@ && find(c.getParameters().begin(), c.getParameters().end(), "ADBAS0") == c.getParameters().end()) { fire(ClientListener::StatusMessage(), this, "Failed to negotiate base protocol"); // @todo internationalize - disconnect(false); + socket->disconnect(false); return; } } @@ -337,12 +341,9 @@ } void AdcHub::disconnect(bool graceless) { + Client::disconnect(graceless); state = STATE_PROTOCOL; - Client::disconnect(graceless); - { - Lock l(cs); - clearUsers(); - } + clearUsers(); } void AdcHub::hubMessage(const string& aMessage) { @@ -413,7 +414,7 @@ if(state != STATE_IDENTIFY && state != STATE_NORMAL) return; - reloadSettings(); + reloadSettings(false); AdcCommand c(AdcCommand::CMD_INF, AdcCommand::TYPE_BROADCAST); string tmp; Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -106,9 +106,9 @@ sock = secure ? SSLSocketFactory::getInstance()->getClientSocket() : new Socket; sock->create(); - if(SETTING(SOCKET_IN_BUFFER) > 0) + if(SETTING(SOCKET_IN_BUFFER) >= 1024) sock->setSocketOpt(SO_RCVBUF, SETTING(SOCKET_IN_BUFFER)); - if(SETTING(SOCKET_OUT_BUFFER) > 0) + if(SETTING(SOCKET_OUT_BUFFER) >= 1024) sock->setSocketOpt(SO_SNDBUF, SETTING(SOCKET_OUT_BUFFER)); sock->setBlocking(false); @@ -261,35 +261,72 @@ dcassert(file != NULL); size_t sockSize = (size_t)sock->getSocketOptInt(SO_SNDBUF); size_t bufSize = max(sockSize, (size_t)64*1024); - dcdebug("threadSendFile buffer size: %lu\n", bufSize); - AutoArray<u_int8_t> buf(bufSize); + + vector<u_int8_t> readBuf(bufSize); + vector<u_int8_t> writeBuf(bufSize); + size_t readPos = 0; + + bool readDone = false; + dcdebug("Starting threadSend"); while(true) { - size_t bytesRead = bufSize; - size_t actual = file->read(&buf[0], bytesRead); - if(actual == 0) { + if(!readDone && readBuf.size() > readPos) { + // Fill read buffer + size_t bytesRead = readBuf.size() - readPos; + size_t actual = file->read(&readBuf[readPos], bytesRead); + + if(bytesRead > 0) { + fire(BufferedSocketListener::BytesSent(), bytesRead, 0); + } + + if(actual == 0) { + readDone = true; + } else { + readPos += actual; + } + } + + if(readDone && readPos == 0) { fire(BufferedSocketListener::TransmitDone()); return; } - size_t done = 0; - size_t doneRead = 0; - while(done < actual) { + readBuf.swap(writeBuf); + readBuf.resize(bufSize); + writeBuf.resize(readPos); + readPos = 0; + + size_t writePos = 0; + + while(writePos < writeBuf.size()) { if(disconnecting) return; - - int written = sock->write(buf + done, min(sockSize, actual - done)); + size_t writeSize = min(sockSize / 2, writeBuf.size() - writePos); + int written = sock->write(&writeBuf[writePos], writeSize); if(written > 0) { - done += written; + writePos += written; - size_t doneReadNow = static_cast<size_t>((static_cast<double>(done)/actual) * bytesRead); + fire(BufferedSocketListener::BytesSent(), 0, written); + } else if(written == -1) { + if(readPos < readBuf.size()) { + // Read a little since we're blocking anyway... + size_t bytesRead = min(readBuf.size() - readPos, readBuf.size() / 2); + size_t actual = file->read(&readBuf[readPos], bytesRead); - fire(BufferedSocketListener::BytesSent(), doneReadNow - doneRead, written); - doneRead = doneReadNow; - } else if(written == -1) { - int w = sock->wait(POLL_TIMEOUT, Socket::WAIT_WRITE | Socket::WAIT_READ); - if(w & Socket::WAIT_READ) { - threadRead(); + if(bytesRead > 0) { + fire(BufferedSocketListener::BytesSent(), bytesRead, 0); + } + + if(actual == 0) { + readDone = true; + } else { + readPos += actual; + } + } else { + int w = sock->wait(POLL_TIMEOUT, Socket::WAIT_WRITE | Socket::WAIT_READ); + if(w & Socket::WAIT_READ) { + threadRead(); + } } } } Modified: dcplusplus/trunk/client/Client.cpp =================================================================== --- dcplusplus/trunk/client/Client.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/Client.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -30,7 +30,7 @@ Client::Client(const string& hubURL, char separator_, bool secure_) : reconnDelay(120), lastActivity(0), registered(false), socket(NULL), - hubUrl(hubURL), port(0), separator(separator_), + hubUrl(hubURL), port(0), separator(separator_), secure(secure_), countType(COUNT_UNCOUNTED) { string file; @@ -49,10 +49,11 @@ } } -void Client::reloadSettings() { +void Client::reloadSettings(bool updateNick) { FavoriteHubEntry* hub = FavoriteManager::getInstance()->getFavoriteHubEntry(getHubUrl()); if(hub) { - getMyIdentity().setNick(checkNick(hub->getNick(true))); + if(updateNick) + getMyIdentity().setNick(checkNick(hub->getNick(true))); if(!hub->getUserDescription().empty()) { getMyIdentity().setDescription(hub->getUserDescription()); } else { @@ -72,7 +73,7 @@ BufferedSocket::putSocket(socket); setReconnDelay(120 + Util::rand(0, 60)); - reloadSettings(); + reloadSettings(true); setRegistered(false); try { @@ -89,6 +90,13 @@ updateActivity(); } +void Client::disconnect(bool graceLess) { + if(!socket) + return; + socket->removeListener(this); + socket->disconnect(graceLess); +} + void Client::updateActivity() { lastActivity = GET_TICK(); } Modified: dcplusplus/trunk/client/Client.h =================================================================== --- dcplusplus/trunk/client/Client.h 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/Client.h 2006-02-26 21:19:47 UTC (rev 582) @@ -84,7 +84,7 @@ typedef List::iterator Iter; virtual void connect(); - virtual void disconnect(bool graceless) { if(socket) socket->disconnect(graceless); } + virtual void disconnect(bool graceless); virtual void connect(const OnlineUser& user) = 0; virtual void hubMessage(const string& aMessage) = 0; @@ -173,8 +173,8 @@ void updateCounts(bool aRemove); void updateActivity(); - // reload nick from settings, other details from favmanager - void reloadSettings(); + /** Reload details from favmanager or settings */ + void reloadSettings(bool updateNick); virtual string checkNick(const string& nick) = 0; Modified: dcplusplus/trunk/client/CriticalSection.h =================================================================== --- dcplusplus/trunk/client/CriticalSection.h 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/CriticalSection.h 2006-02-26 21:19:47 UTC (rev 582) @@ -127,21 +127,19 @@ ~RWLock() throw() { dcassert(readers==0); } void enterRead() throw() { - Lock l(cs); + cs.enter(); readers++; dcassert(readers < 100); + cs.leave(); } - void leaveRead() throw() { + dcassert(readers > 0); Thread::safeDec(readers); - dcassert(readers >= 0); } void enterWrite() throw() { cs.enter(); while(readers > 0) { - cs.leave(); Thread::yield(); - cs.enter(); } } void leaveWrite() { Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ void NmdcHub::connect(const OnlineUser& aUser) { checkstate(); - dcdebug("NmdcHub::connectToMe %s\n", aUser.getIdentity().getNick().c_str()); + dcdebug("NmdcHub::connect %s\n", aUser.getIdentity().getNick().c_str()); if(ClientManager::getInstance()->isActive()) { connectToMe(aUser); } else { @@ -84,15 +84,19 @@ NickIter i = users.find(aNick); if(i != users.end()) return *i->second; + } - User::Ptr p; - if(aNick == getMyNick()) { - p = ClientManager::getInstance()->getMe(); - getMyIdentity().setUser(p); - getMyIdentity().setHubUrl(getHubUrl()); - } else { - p = ClientManager::getInstance()->getUser(aNick, getHubUrl()); - } + User::Ptr p; + if(aNick == getMyNick()) { + p = ClientManager::getInstance()->getMe(); + getMyIdentity().setUser(p); + getMyIdentity().setHubUrl(getHubUrl()); + } else { + p = ClientManager::getInstance()->getUser(aNick, getHubUrl()); + } + + { + Lock l(cs); u = users.insert(make_pair(aNick, new OnlineUser(p, *this, 0))).first->second; u->getIdentity().setNick(aNick); } @@ -525,12 +529,12 @@ fire(ClientListener::UserUpdated(), this, u); } } else if(cmd == "$ForceMove") { - disconnect(false); + socket->disconnect(false); fire(ClientListener::Redirect(), this, param); } else if(cmd == "$HubIsFull") { fire(ClientListener::HubFull(), this); } else if(cmd == "$ValidateDenide") { // Mind the spelling... - disconnect(false); + socket->disconnect(false); fire(ClientListener::NickTaken(), this); } else if(cmd == "$UserIP") { if(!param.empty()) { @@ -684,7 +688,7 @@ void NmdcHub::myInfo(bool alwaysSend) { checkstate(); - reloadSettings(); + reloadSettings(false); dcdebug("MyInfo %s...\n", getMyNick().c_str()); lastCounts = counts; @@ -726,8 +730,8 @@ } void NmdcHub::disconnect(bool graceless) throw() { + Client::disconnect(graceless); state = STATE_CONNECT; - Client::disconnect(graceless); clearUsers(); } Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -270,6 +270,7 @@ } void QueueManager::UserQueue::setWaiting(QueueItem* qi) { + dcassert(qi->getCurrentDownload() != NULL); dcassert(qi->getCurrent() != NULL); dcassert(qi->getStatus() == QueueItem::STATUS_RUNNING); @@ -278,8 +279,9 @@ running.erase(qi->getCurrent()->getUser()); // Set flag to waiting + qi->setStatus(QueueItem::STATUS_WAITING); qi->setCurrent(NULL); - qi->setStatus(QueueItem::STATUS_WAITING); + qi->setCurrentDownload(NULL); // Add to the userQueue add(qi); @@ -559,7 +561,7 @@ /** Add a source to an existing queue item */ bool QueueManager::addSource(QueueItem* qi, const string& aFile, User::Ptr aUser, Flags::MaskType addBad, bool utf8) throw(QueueException, FileException) { QueueItem::Source* s = NULL; - bool wantConnection = (qi->getPriority() != QueueItem::PAUSED); + bool wantConnection = (qi->getPriority() != QueueItem::PAUSED) && (qi->getStatus() != QueueItem::STATUS_RUNNING); if(qi->isSource(aUser)) { throw QueueException(STRING(DUPLICATE_SOURCE)); @@ -582,9 +584,7 @@ wantConnection = false; } else if(qi->getStatus() != QueueItem::STATUS_RUNNING) { userQueue.add(qi, aUser); - } else { - wantConnection = false; - } + } aUser->setFlag(User::SAVE_NICK); @@ -768,7 +768,6 @@ } } - Download* QueueManager::getDownload(User::Ptr& aUser, bool supportsTrees) throw() { Lock l(cs); @@ -789,10 +788,10 @@ userQueue.setRunning(q, aUser); - fire(QueueManagerListener::StatusUpdated(), q); - Download* d = new Download(q); + q->setCurrentDownload(d); + if(d->getSize() != -1 && d->getTTH()) { if(HashManager::getInstance()->getTree(*d->getTTH(), d->getTigerTree())) { d->setTreeValid(true); @@ -814,8 +813,8 @@ d->setStartPos(q->getDownloadedBytes()); } - q->setCurrentDownload(d); + fire(QueueManagerListener::StatusUpdated(), q); return d; } @@ -837,7 +836,6 @@ fire(QueueManagerListener::PartialList(), aDownload->getUserConnection()->getUser(), aDownload->getPFS()); } } else { - QueueItem* q = fileQueue.find(aDownload->getTarget()); if(q != NULL) { @@ -849,7 +847,6 @@ } } - if(finished) { dcassert(q->getStatus() == QueueItem::STATUS_RUNNING); if(aDownload->isSet(Download::FLAG_TREE_DOWNLOAD)) { @@ -857,12 +854,10 @@ dcassert(aDownload->getTreeValid()); HashManager::getInstance()->addTree(aDownload->getTigerTree()); - q->setCurrentDownload(NULL); userQueue.setWaiting(q); fire(QueueManagerListener::StatusUpdated(), q); } else { - userQueue.remove(q); fire(QueueManagerListener::Finished(), q, aDownload->getAverageSpeed()); fire(QueueManagerListener::Removed(), q); // Now, let's see if this was a directory download filelist... @@ -874,6 +869,7 @@ flag = (q->isSet(QueueItem::FLAG_DIRECTORY_DOWNLOAD) ? QueueItem::FLAG_DIRECTORY_DOWNLOAD : 0) | (q->isSet(QueueItem::FLAG_MATCH_QUEUE) ? QueueItem::FLAG_MATCH_QUEUE : 0); } + userQueue.remove(q); fileQueue.remove(q); setDirty(); } @@ -893,15 +889,9 @@ } if(q->getPriority() != QueueItem::PAUSED) { - for(QueueItem::Source::Iter j = q->getSources().begin(); j != q->getSources().end(); ++j) { - if((*j)->getUser()->isOnline()) { - getConn.push_back((*j)->getUser()); - } - } + q->getOnlineUsers(getConn); } - q->setCurrentDownload(NULL); - // This might have been set to wait by removesource already... if(q->getStatus() == QueueItem::STATUS_RUNNING) { userQueue.setWaiting(q); @@ -963,49 +953,58 @@ void QueueManager::remove(const string& aTarget) throw() { string x; + { Lock l(cs); QueueItem* q = fileQueue.find(aTarget); - if(q != NULL) { - if(q->isSet(QueueItem::FLAG_DIRECTORY_DOWNLOAD)) { - dcassert(q->getSources().size() == 1); - DirectoryItem::DirectoryPair dp = directories.equal_range(q->getSources()[0]->getUser()); - for(DirectoryItem::DirectoryIter i = dp.first; i != dp.second; ++i) { - delete i->second; - } - directories.erase(q->getSources()[0]->getUser()); - } + if(q == NULL) + return; - if(q->getStatus() == QueueItem::STATUS_RUNNING) { - x = q->getTarget(); - } else if(!q->getTempTarget().empty() && q->getTempTarget() != q->getTarget()) { - File::deleteFile(q->getTempTarget() + Download::ANTI_FRAG_EXT); - File::deleteFile(q->getTempTarget()); + if(q->isSet(QueueItem::FLAG_DIRECTORY_DOWNLOAD)) { + dcassert(q->getSources().size() == 1); + DirectoryItem::DirectoryPair dp = directories.equal_range(q->getSources()[0]->getUser()); + for(DirectoryItem::DirectoryIter i = dp.first; i != dp.second; ++i) { + delete i->second; } + directories.erase(q->getSources()[0]->getUser()); + } - userQueue.remove(q); + if(q->getStatus() == QueueItem::STATUS_RUNNING) { + x = q->getTarget(); + } else if(!q->getTempTarget().empty() && q->getTempTarget() != q->getTarget()) { + File::deleteFile(q->getTempTarget() + Download::ANTI_FRAG_EXT); + File::deleteFile(q->getTempTarget()); + } - fire(QueueManagerListener::Removed(), q); - fileQueue.remove(q); + fire(QueueManagerListener::Removed(), q); - setDirty(); - } + userQueue.remove(q); + fileQueue.remove(q); + + setDirty(); } + if(!x.empty()) { DownloadManager::getInstance()->abortDownload(x); } } void QueueManager::removeSource(const string& aTarget, User::Ptr& aUser, int reason, bool removeConn /* = true */) throw() { - Lock l(cs); - QueueItem* q = fileQueue.find(aTarget); string x; - if(q != NULL) { - dcassert(q->isSource(aUser)); + bool removeCompletely = false; + { + Lock l(cs); + QueueItem* q = fileQueue.find(aTarget); + if(q == NULL) + return; + + if(!q->isSource(aUser)) + return; + if(q->isSet(QueueItem::FLAG_USER_LIST)) { - remove(q->getTarget()); - return; + removeCompletely = true; + goto endCheck; } if(reason == QueueItem::Source::FLAG_NO_TREE) { @@ -1034,23 +1033,28 @@ } q->removeSource(aUser, reason); - + fire(QueueManagerListener::SourcesUpdated(), q); setDirty(); } +endCheck: if(!x.empty()) { DownloadManager::getInstance()->abortDownload(x); } + if(removeCompletely) { + remove(aTarget); + } } void QueueManager::removeSource(User::Ptr& aUser, int reason) throw() { string x; + StringList removeList; { Lock l(cs); QueueItem* qi = NULL; while( (qi = userQueue.getNext(aUser, QueueItem::PAUSED)) != NULL) { if(qi->isSet(QueueItem::FLAG_USER_LIST)) { - remove(qi->getTarget()); + removeList.push_back(qi->getTarget()); } else { userQueue.remove(qi, aUser); qi->removeSource(aUser, reason); @@ -1062,7 +1066,7 @@ qi = userQueue.getRunning(aUser); if(qi != NULL) { if(qi->isSet(QueueItem::FLAG_USER_LIST)) { - remove(qi->getTarget()); + removeList.push_back(qi->getTarget()); } else { userQueue.setWaiting(qi); userQueue.remove(qi, aUser); @@ -1073,9 +1077,13 @@ } } } + if(!x.empty()) { DownloadManager::getInstance()->abortDownload(x); } + for(StringIter i = removeList.begin(); i != removeList.end(); ++i) { + remove(*i); + } } void QueueManager::setPriority(const string& aTarget, QueueItem::Priority p) throw() { @@ -1086,7 +1094,7 @@ QueueItem* q = fileQueue.find(aTarget); if( (q != NULL) && (q->getPriority() != p) ) { - if( q->getStatus() != QueueItem::STATUS_RUNNING ) { + if( q->getStatus() == QueueItem::STATUS_WAITING ) { if(q->getPriority() == QueueItem::PAUSED || p == QueueItem::HIGHEST) { // Problem, we have to request connections to all these users... q->getOnlineUsers(ul); Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -364,6 +364,7 @@ "Use antifragmentation method for downloads", "Appearance", "Appearance\\Colors and sounds", +"Autodrop settings", "Drop sources below", "Check every", "Min elapsed", @@ -446,6 +447,7 @@ "Open new window when using /join", "Always open help file with this dialog", "Options", +"Other queue options", "Outgoing connection settings", "Don't allow hub/UPnP to override", "Personal Information", @@ -473,7 +475,7 @@ "Total size:", "Shared directories", "Show joins / parts in chat by default", -"Show progress bars for transfers (uses some CPU)", +"Show progress bars for transfers", "Skip zero-byte files", "Use small send buffer (enable if uploads slow downloads a lot)", "SOCKS5", @@ -486,6 +488,7 @@ "View status messages in main chat", "TCP Port", "Mini slot size", +"Autoprio settings", "Highest prio max size", "High prio max size", "Normal prio max size", @@ -961,6 +964,7 @@ "SettingsAntiFrag", "SettingsAppearance", "SettingsAppearance2", +"SettingsAutodropAutodropsettings", "SettingsAutodropSpeed", "SettingsAutodropInterval", "SettingsAutodropElapsed", @@ -1043,6 +1047,7 @@ "SettingsOpenNewWindow", "SettingsOpenUserCmdHelp", "SettingsOptions", +"SettingsOtherQueueOptions", "SettingsOutgoing", "SettingsOverride", "SettingsPersonalInformation", @@ -1083,6 +1088,7 @@ "SettingsStatusInChat", "SettingsTcpPort", "SettingsTextMinislot", +"SettingsPrioAutoprio", "SettingsPrioHighest", "SettingsPrioHigh", "SettingsPrioNormal", Modified: dcplusplus/trunk/client/Thread.h =================================================================== --- dcplusplus/trunk/client/Thread.h 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/Thread.h 2006-02-26 21:19:47 UTC (rev 582) @@ -67,7 +67,7 @@ void setThreadPriority(Priority p) throw() { ::SetThreadPriority(threadHandle, p); } static void sleep(u_int32_t millis) { ::Sleep(millis); } - static void yield() { ::Sleep(0); } + static void yield() { ::Sleep(1); } 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); } Modified: dcplusplus/trunk/client/version.h =================================================================== --- dcplusplus/trunk/client/version.h 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/client/version.h 2006-02-26 21:19:47 UTC (rev 582) @@ -17,8 +17,8 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.686" -#define VERSIONFLOAT 0.686 +#define VERSIONSTRING "0.687" +#define VERSIONFLOAT 0.687 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/help/changelog.html 2006-02-26 21:19:47 UTC (rev 582) @@ -12,6 +12,7 @@ <body> <h1>DC++ Changelog</h1> See the version history of DC++ below. + <h2>0.686 <span style="color: gray;">(2006-02-13)</span></h2> <ul> <li>Fixed active search (oops)</li> Property changes on: dcplusplus/trunk/stlport ___________________________________________________________________ Name: svn:ignore + * Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-02-26 21:19:47 UTC (rev 582) @@ -221,9 +221,9 @@ removeFavoriteHub(); } else if(Util::stricmp(cmd.c_str(), _T("getlist")) == 0){ if( !param.empty() ){ - int k = ctrlUsers.findItem(param); - if(k != -1) { - ctrlUsers.getItemData(k)->getList(); + UserInfo* ui = findUser(param); + if(ui) { + ui->getList(); } } } else if(Util::stricmp(cmd.c_str(), _T("log")) == 0) { @@ -242,18 +242,17 @@ string::size_type j = param.find(_T(' ')); if(j != string::npos) { tstring nick = param.substr(0, j); - int k = ctrlUsers.findItem(nick); - if(k != -1) { - UserInfo* ui = ctrlUsers.getItemData(k); - if(param.size() > j + 1) + UserInfo* ui = findUser(nick); + + if(ui) { + if(param.size() > j + 1) PrivateFrame::openWindow(ui->user, param.substr(j+1)); - else + else PrivateFrame::openWindow(ui->user); } } else if(!param.empty()) { - int k = ctrlUsers.findItem(param); - if(k != -1) { - UserInfo* ui = ctrlUsers.getItemData(k); + UserInfo* ui = findUser(param); + if(ui) { PrivateFrame::openWindow(ui->user); } } @@ -287,21 +286,6 @@ const int col; }; -int HubFrame::findUser(const User::Ptr& aUser) { - UserMapIter i = userMap.find(aUser); - if(i == userMap.end()) - return -1; - - UserInfo* ui = i->second; - - if(ctrlUsers.getSortColumn() == COLUMN_NICK) { - // Sort order of the other columns changes too late when the user's updated - dcassert(ctrlUsers.getItemData(ctrlUsers.getSortPos(ui)) == ui); - return ctrlUsers.getSortPos(ui); - } - return ctrlUsers.findItem(ui); -} - const tstring& HubFrame::getNick(const User::Ptr& aUser) { UserMapIter i = userMap.find(aUser); if(i == userMap.end()) @@ -420,6 +404,14 @@ delete ui; } +HubFrame::UserInfo* HubFrame::findUser(const tstring& nick) { + for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i) { + if(i->second->columns[COLUMN_NICK] == nick) + return i->second; + } + return 0; +} + bool HubFrame::UserInfo::update(const Identity& identity, int sortCol) { bool needsSort = (getIdentity().isOp() != identity.isOp()); tstring old; @@ -661,21 +653,25 @@ return 0; // Nickname click, let's see if we can find one like it in the name list... - int pos = ctrlUsers.findItem(x.substr(start, end - start)); - if(pos != -1) { + tstring nick = x.substr(start, end - start); + UserInfo* ui = findUser(nick); + if(ui) { bHandled = true; if (wParam & MK_CONTROL) { // MK_CONTROL = 0x0008 - PrivateFrame::openWindow(ctrlUsers.getItemData(pos)->user); + PrivateFrame::openWindow(ui->user); } else if (wParam & MK_SHIFT) { try { - QueueManager::getInstance()->addList(ctrlUsers.getItemData(pos)->user, QueueItem::FLAG_CLIENT_VIEW); + QueueManager::getInstance()->addList(ui->user, QueueItem::FLAG_CLIENT_VIEW); } catch(const Exception& e) { addClientLine(Text::toT(e.getError())); } - } else { + } else if(showUsers) { int items = ctrlUsers.GetItemCount(); + int pos = -1; ctrlUsers.SetRedraw(FALSE); for(int i = 0; i < items; ++i) { + if(ctrlUsers.getItemData(i) == ui) + pos = i; ctrlUsers.SetItemState(i, (i == pos) ? LVIS_SELECTED | LVIS_FOCUSED : 0, LVIS_SELECTED | LVIS_FOCUSED); } ctrlUsers.SetRedraw(TRUE); @@ -739,6 +735,18 @@ return TRUE; } +LRESULT HubFrame::onCtlColor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { + HWND hWnd = (HWND)lParam; + HDC hDC = (HDC)wParam; + if(hWnd == ctrlClient.m_hWnd || hWnd == ctrlMessage.m_hWnd) { + ::SetBkColor(hDC, WinUtil::bgColor); + ::SetTextColor(hDC, WinUtil::textColor); + return (LRESULT)WinUtil::bgBrush; + } else { + return 0; + } +} + LRESULT HubFrame::onContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; @@ -763,6 +771,7 @@ } // Nickname click, let's see if we can find one like it in the name list... + int pos = ctrlUsers.findItem(x.substr(start, end - start)); if(pos != -1) { int items = ctrlUsers.GetItemCount(); Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-02-25 19:14:25 UTC (rev 581) +++ dcplusplus/trunk/windows/HubFrame.h 2006-02-26 21:19:47 UTC (rev 582) @@ -97,6 +97,7 @@ LRESULT onLButton(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); LRESULT onEnterUsers(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onGetToolTip(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); + LRESULT onCtlColor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); void UpdateLayout(BOOL bResizeBars = TRUE); void addLine(const tstring& aLine); @@ -128,18 +129,6 @@ return 0; } - LRESULT onCtlColor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { - HWND hWnd = (HWND)lParam; - HDC hDC = (HDC)wParam; - if(hWnd == ctrlClient.m_hWnd || hWnd == ctrlMessage.m_hWnd) { - ::SetBkColor(hDC, WinUtil::bgColor); - ::SetTextColor(hDC, WinUtil::textColor); - return (LRESULT)WinUtil::bgBrush; - } else { - return 0; - } - } - LRESULT OnFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { client->disconnect(false); clearUserList(); @@ -259,10 +248,6 @@ bool favShowJoins; tstring complete; - tstring lastKick; - tstring lastRedir; - tstring lastServer; - bool waitingForPW; bool extraSort; @@ -280,7 +265,7 @@ size_t getUserCount() const { size_t sel = ctrlUsers.GetSelectedCount(); - return sel>1?sel:client->getUserCount(); + return sel > 1 ? sel : client->getUserCount(); } int64_t getAvailable() { @@ -333,11 +318,11 @@ static int columnIndexes[COLUMN_LAST]; static int columnSizes[COLUMN_LAST]; - int findUser(const User::Ptr& aUser); - bool updateUser(const UpdateInfo& u); void removeUser(const User::Ptr& aUser); + UserInfo* findUser(const tstring& nick); + void addAsFavorite(); void removeFavoriteHub(); Property changes on: dcplusplus/trunk/wtl ___________________________________________________________________ Name: svn:ignore + *.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-02-26 23:36:41
|
Revision: 583 Author: arnetheduck Date: 2006-02-26 15:36:21 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=583&view=rev Log Message: ----------- Last few changes for release Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/windows/AboutDlg.h Added Paths: ----------- dcplusplus/trunk/opencow.dll Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-02-26 21:19:47 UTC (rev 582) +++ dcplusplus/trunk/changelog.txt 2006-02-26 23:36:21 UTC (rev 583) @@ -1,4 +1,4 @@ --- 0.guess.what -- +-- 0.687 2006-02-26 -- * Fixed XML file list generation for invalid filenames from other os's * Fixed a rare refresh crash * CID is now shown if no nick name is currently available for a user @@ -12,6 +12,8 @@ * Fixed some translation strings (thanks fleetcommand) * Fixed some finished transfers frames issues (thanks trem) * /pm and and a few other things work without user list in hub frame +* Added support for the ZPipe extension (test version) (thanks jove) +* Moved to subversion, CVS will no longer be maintained -- 0.686 2006-02-13 -- * Fixed active search (oops) Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-02-26 21:19:47 UTC (rev 582) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-02-26 23:36:21 UTC (rev 583) @@ -495,7 +495,7 @@ feat.push_back("NoHello"); feat.push_back("UserIP2"); feat.push_back("TTHSearch"); - feat.push_back("ZPipe"); + feat.push_back("ZPipe0"); if(BOOLSETTING(COMPRESS_TRANSFERS)) feat.push_back("GetZBlock"); Added: dcplusplus/trunk/opencow.dll =================================================================== (Binary files differ) Property changes on: dcplusplus/trunk/opencow.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: dcplusplus/trunk/windows/AboutDlg.h =================================================================== --- dcplusplus/trunk/windows/AboutDlg.h 2006-02-26 21:19:47 UTC (rev 582) +++ dcplusplus/trunk/windows/AboutDlg.h 2006-02-26 23:36:21 UTC (rev 583) @@ -41,7 +41,7 @@ _T("theparanoidone, gadget, naga, tremor, joakim tosteberg, pofis, psf8500, lauris ievins, ") _T("defr, ullner, fleetcommand, liny, xan, olle svensson, mark gillespie, jeremy huddleston, ") _T("bsod, sulan, jonathan stone, tim burton, izzzo, guitarm, paka, nils maier, jens oknelid, yoji, ") -_T("krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin. ") +_T("krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin, jove. ") _T("Keep it coming!"); class AboutDlg : public CDialogImpl<AboutDlg>, private HttpConnectionListener This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-03-16 22:49:53
|
Revision: 588 Author: arnetheduck Date: 2006-03-16 14:49:30 -0800 (Thu, 16 Mar 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=588&view=rev Log Message: ----------- A few small fixes Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/version.h dcplusplus/trunk/help/changelog.html dcplusplus/trunk/windows/PrivateFrame.cpp dcplusplus/trunk/windows/WaitingUsersFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/changelog.txt 2006-03-16 22:49:30 UTC (rev 588) @@ -1,4 +1,11 @@ --- 0.687 2006-02-26 -- +-- 0.688 -- +* Fixed public hubs sorting (thanks pothead) +* Fixed a ZPipe issue (thanks jove) +* Fixed a 100% cpu / crash bug +* [bug 872] Fixed a pm issue hopefully +* [bug 812] Fixed pm's being sent to bots + +-- 0.687 2006-02-26 -- * Fixed XML file list generation for invalid filenames from other os's * Fixed a rare refresh crash * CID is now shown if no nick name is currently available for a user Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-03-16 22:49:30 UTC (rev 588) @@ -42,7 +42,7 @@ BufferedSocket::~BufferedSocket() throw() { delete sock; - if (filterIn) delete filterIn; + delete filterIn; sockets--; } Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-03-16 22:49:30 UTC (rev 588) @@ -93,6 +93,8 @@ getMyIdentity().setHubUrl(getHubUrl()); } else { p = ClientManager::getInstance()->getUser(aNick, getHubUrl()); + // In NMDC, everyone's a bot until they show a good myinfo + p->setFlag(User::BOT); } { @@ -317,6 +319,8 @@ OnlineUser& u = getUser(nick); + u.getUser()->unsetFlag(User::BOT); + j = param.find('$', i); if(j == string::npos) return; Modified: dcplusplus/trunk/client/version.h =================================================================== --- dcplusplus/trunk/client/version.h 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/client/version.h 2006-03-16 22:49:30 UTC (rev 588) @@ -17,8 +17,8 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.687" -#define VERSIONFLOAT 0.687 +#define VERSIONSTRING "0.6875" +#define VERSIONFLOAT 0.6875 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/help/changelog.html 2006-03-16 22:49:30 UTC (rev 588) @@ -13,6 +13,25 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.687 <span style="color: gray;">(2006-02-26)</span></h2> +<ul> + <li>Fixed XML file list generation for invalid filenames from other os's</li> + <li>Fixed a rare refresh crash</li> + <li>CID is now shown if no nick name is currently available for a user</li> + <li>Fixed another crash when loading file lists</li> + <li>Played some more with bufferedsocket performance</li> + <li>Fixed some VS 2005 issues (thanks trem)</li> + <li>Installer now removes old unicows library</li> + <li>Updated to yaSSL 1.1.5</li> + <li>Added possiblity to sort transfer view by all downloads first (thanks guitarm)</li> + <li>Some cleanup for frame creation (thanks martin)</li> + <li>Fixed some translation strings (thanks fleetcommand)</li> + <li>Fixed some finished transfers frames issues (thanks trem)</li> + <li>/pm and and a few other things work without user list in hub frame</li> + <li>Added support for the ZPipe extension (test version) (thanks jove)</li> + <li>Moved to subversion, CVS will no longer be maintained</li> +</ul> + <h2>0.686 <span style="color: gray;">(2006-02-13)</span></h2> <ul> <li>Fixed active search (oops)</li> Modified: dcplusplus/trunk/windows/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/windows/PrivateFrame.cpp 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/windows/PrivateFrame.cpp 2006-03-16 22:49:30 UTC (rev 588) @@ -71,7 +71,7 @@ void PrivateFrame::gotMessage(const User::Ptr& from, const User::Ptr& to, const User::Ptr& replyTo, const tstring& aMessage) { PrivateFrame* p = NULL; - const User::Ptr& user = (from == ClientManager::getInstance()->getMe()) ? to : replyTo; + const User::Ptr& user = (replyTo == ClientManager::getInstance()->getMe()) ? to : replyTo; FrameIter i = frames.find(user); if(i == frames.end()) { Modified: dcplusplus/trunk/windows/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/windows/WaitingUsersFrame.cpp 2006-03-08 22:45:13 UTC (rev 587) +++ dcplusplus/trunk/windows/WaitingUsersFrame.cpp 2006-03-16 22:49:30 UTC (rev 588) @@ -181,7 +181,6 @@ LRESULT WaitingUsersFrame::onAddToFavorites(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { User::Ptr user = getSelectedUser(); if (user) { - User::Ptr user = user; FavoriteManager::getInstance()->addFavoriteUser(user); } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-03-17 22:58:09
|
Revision: 589 Author: arnetheduck Date: 2006-03-17 14:57:48 -0800 (Fri, 17 Mar 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=589&view=rev Log Message: ----------- sfv check added to hashing Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/HashManager.cpp dcplusplus/trunk/client/HashManager.h dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/StringDefs.h Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-03-16 22:49:30 UTC (rev 588) +++ dcplusplus/trunk/Example.xml 2006-03-17 22:57:48 UTC (rev 589) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.687" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.6875" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> @@ -278,6 +278,7 @@ <String Name="Nick">Nick</String> <String Name="NickTaken">Your nick was already taken, please change to something else!</String> <String Name="NickUnknown"> (Nick unknown)</String> + <String Name="NoCrc32Match"> not shared; calculated CRC32 does not match the one found in SFV file.</String> <String Name="NoStr">No</String> <String Name="NoDirectorySpecified">No directory specified</String> <String Name="NoDownloadsFromSelf">You're trying to download from yourself!</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-16 22:49:30 UTC (rev 588) +++ dcplusplus/trunk/changelog.txt 2006-03-17 22:57:48 UTC (rev 589) @@ -4,6 +4,7 @@ * Fixed a 100% cpu / crash bug * [bug 872] Fixed a pm issue hopefully * [bug 812] Fixed pm's being sent to bots +* Files with invalid crc-32, as per their sfv file, are no longer shared -- 0.687 2006-02-26 -- * Fixed XML file list generation for invalid filenames from other os's Modified: dcplusplus/trunk/client/HashManager.cpp =================================================================== --- dcplusplus/trunk/client/HashManager.cpp 2006-03-16 22:49:30 UTC (rev 588) +++ dcplusplus/trunk/client/HashManager.cpp 2006-03-17 22:57:48 UTC (rev 589) @@ -24,6 +24,8 @@ #include "SimpleXML.h" #include "LogManager.h" #include "File.h" +#include "ZUtils.h" +#include "SFVReader.h" #define HASH_FILE_VERSION_STRING "2" static const u_int32_t HASH_FILE_VERSION=2; @@ -438,7 +440,7 @@ #define BUF_SIZE (256*1024) #ifdef _WIN32 -bool HashManager::Hasher::fastHash(const string& fname, u_int8_t* buf, TigerTree& tth, int64_t size) { +bool HashManager::Hasher::fastHash(const string& fname, u_int8_t* buf, TigerTree& tth, int64_t size, CRC32Filter* xcrc32) { HANDLE h = INVALID_HANDLE_VALUE; DWORD x, y; if(!GetDiskFreeSpace(Text::toT(Util::getFilePath(fname)).c_str(), &y, &x, &y, &y)) { @@ -503,8 +505,13 @@ } tth.update(hbuf, hn); - total -= hn; + if(xcrc32) (*xcrc32)(hbuf, hn); + { + Lock l(cs); + currentSize = max(currentSize - hn, _LL(0)); + } + if(size == 0) { ok = true; break; @@ -560,7 +567,8 @@ { Lock l(cs); if(!w.empty()) { - file = fname = w.begin()->first; + currentFile = fname = w.begin()->first; + currentSize = w.begin()->second; w.erase(w.begin()); last = w.empty(); } else { @@ -586,18 +594,24 @@ try { File f(fname, File::READ, File::OPEN); int64_t bs = max(TigerTree::calcBlockSize(f.getSize(), 10), MIN_BLOCK_SIZE); -#ifdef _WIN32 u_int32_t start = GET_TICK(); -#endif u_int32_t timestamp = f.getLastModified(); TigerTree slowTTH(bs); TigerTree* tth = &slowTTH; + + CRC32Filter crc32; + SFVReader sfv(fname); + CRC32Filter* xcrc32 = 0; + if(sfv.hasCRC()) + xcrc32 = &crc32; + size_t n = 0; #ifdef _WIN32 TigerTree fastTTH(bs); tth = &fastTTH; - if(!virtualBuf || !fastHash(fname, buf, fastTTH, size)) { + if(!virtualBuf || !fastHash(fname, buf, fastTTH, size, xcrc32)) { tth = &slowTTH; + crc32 = CRC32Filter(); #endif u_int32_t lastRead = GET_TICK(); @@ -612,8 +626,12 @@ } n = f.read(buf, bufSize); tth->update(buf, n); + if(xcrc32) (*xcrc32)(buf, n); - total -= n; + { + Lock l(cs); + currentSize = max(currentSize - n, _LL(0)); + } sizeLeft -= n; } while (n > 0 && !stop); #ifdef _WIN32 @@ -623,22 +641,25 @@ #endif f.close(); tth->finalize(); -#ifdef _WIN32 u_int32_t end = GET_TICK(); int64_t speed = 0; if(end > start) { - speed = size * 1000LL / (end - start); + speed = size * _LL(1000) / (end - start); } -#else - int64_t speed = 0; -#endif - HashManager::getInstance()->hashDone(fname, timestamp, *tth, speed); + if(xcrc32 && xcrc32->getValue() != sfv.getCRC()) { + LogManager::getInstance()->message(fname + STRING(NO_CRC32_MATCH)); + } else { + HashManager::getInstance()->hashDone(fname, timestamp, *tth, speed); + } } catch(const FileException& e) { LogManager::getInstance()->message(STRING(ERROR_HASHING) + fname + ": " + e.getError()); } - - total -= sizeLeft; } + { + Lock l(cs); + currentFile.clear(); + currentSize = 0; + } running = false; if(buf != NULL && (last || stop)) { if(virtualBuf) { Modified: dcplusplus/trunk/client/HashManager.h =================================================================== --- dcplusplus/trunk/client/HashManager.h 2006-03-16 22:49:30 UTC (rev 588) +++ dcplusplus/trunk/client/HashManager.h 2006-03-17 22:57:48 UTC (rev 589) @@ -35,6 +35,7 @@ STANDARD_EXCEPTION(HashException); class File; +class CRC32Filter; class HashManagerListener { public: @@ -117,13 +118,12 @@ class Hasher : public Thread { public: - Hasher() : stop(false), running(false), rebuild(false), total(0) { } + Hasher() : stop(false), running(false), rebuild(false), currentSize(0) { } void hashFile(const string& fileName, int64_t size) { Lock l(cs); if(w.insert(make_pair(fileName, size)).second) { s.signal(); - total += size; } } @@ -131,7 +131,6 @@ Lock l(cs); for(WorkIter i = w.begin(); i != w.end(); ) { if(Util::strnicmp(baseDir, i->first, baseDir.length()) == 0) { - total -= i->second; w.erase(i++); } else { ++i; @@ -141,18 +140,19 @@ virtual int run(); #ifdef _WIN32 - bool fastHash(const string& fname, u_int8_t* buf, TigerTree& tth, int64_t size); + bool fastHash(const string& fname, u_int8_t* buf, TigerTree& tth, int64_t size, CRC32Filter* xcrc32); #endif void getStats(string& curFile, int64_t& bytesLeft, size_t& filesLeft) { Lock l(cs); - curFile = file; + curFile = currentFile; filesLeft = w.size(); if(running) filesLeft++; - // Just in case... - if(total < 0) - total = 0; - bytesLeft = total; + bytesLeft = 0; + for(WorkMap::const_iterator i = w.begin(); i != w.end(); ++i) { + bytesLeft += i->second; + } + bytesLeft += currentSize; } void shutdown() { stop = true; @@ -176,8 +176,8 @@ bool stop; bool running; bool rebuild; - int64_t total; - string file; + string currentFile; + int64_t currentSize; }; friend class Hasher; Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-03-16 22:49:30 UTC (rev 588) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-03-17 22:57:48 UTC (rev 589) @@ -279,6 +279,7 @@ "Nick", "Your nick was already taken, please change to something else!", " (Nick unknown)", +" not shared; calculated CRC32 does not match the one found in SFV file.", "No", "No directory specified", "You're trying to download from yourself!", @@ -879,6 +880,7 @@ "Nick", "NickTaken", "NickUnknown", +"NoCrc32Match", "NoStr", "NoDirectorySpecified", "NoDownloadsFromSelf", Modified: dcplusplus/trunk/client/StringDefs.h =================================================================== --- dcplusplus/trunk/client/StringDefs.h 2006-03-16 22:49:30 UTC (rev 588) +++ dcplusplus/trunk/client/StringDefs.h 2006-03-17 22:57:48 UTC (rev 589) @@ -282,6 +282,7 @@ NICK, // "Nick" NICK_TAKEN, // "Your nick was already taken, please change to something else!" NICK_UNKNOWN, // " (Nick unknown)" + NO_CRC32_MATCH, // " not shared; calculated CRC32 does not match the one found in SFV file." NO_STR, // "No" NO_DIRECTORY_SPECIFIED, // "No directory specified" NO_DOWNLOADS_FROM_SELF, // "You're trying to download from yourself!" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-03-18 16:14:25
|
Revision: 590 Author: arnetheduck Date: 2006-03-18 08:14:10 -0800 (Sat, 18 Mar 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=590&view=rev Log Message: ----------- Hub frame cleanup Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/StringDefs.h dcplusplus/trunk/windows/AboutDlg.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/UsersFrame.cpp dcplusplus/trunk/windows/UsersFrame.h dcplusplus/trunk/windows/WinUtil.h Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/Example.xml 2006-03-18 16:14:10 UTC (rev 590) @@ -48,6 +48,7 @@ <String Name="CompressionError">Error during compression</String> <String Name="Configure">&Configure</String> <String Name="Connect">&Connect</String> + <String Name="ConnectFavuserHub">Connect to hub</String> <String Name="Connected">Connected</String> <String Name="Connecting">Connecting...</String> <String Name="ConnectingForced">Connecting (forced)...</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/changelog.txt 2006-03-18 16:14:10 UTC (rev 590) @@ -1,10 +1,12 @@ -- 0.688 -- * Fixed public hubs sorting (thanks pothead) * Fixed a ZPipe issue (thanks jove) -* Fixed a 100% cpu / crash bug +* [bug 858] Fixed a 100% cpu / crash bug * [bug 872] Fixed a pm issue hopefully * [bug 812] Fixed pm's being sent to bots * Files with invalid crc-32, as per their sfv file, are no longer shared +* [bug 873] Added connect to hub option (thanks joakim tosteberg) +* Fixed an issue with linux file reading (thanks bart vullings and steven) -- 0.687 2006-02-26 -- * Fixed XML file list generation for invalid filenames from other os's Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-03-18 16:14:10 UTC (rev 590) @@ -49,6 +49,7 @@ "Error during compression", "&Configure", "&Connect", +"Connect to hub", "Connected", "Connecting...", "Connecting (forced)...", @@ -650,6 +651,7 @@ "CompressionError", "Configure", "Connect", +"ConnectFavuserHub", "Connected", "Connecting", "ConnectingForced", Modified: dcplusplus/trunk/client/StringDefs.h =================================================================== --- dcplusplus/trunk/client/StringDefs.h 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/client/StringDefs.h 2006-03-18 16:14:10 UTC (rev 590) @@ -52,6 +52,7 @@ COMPRESSION_ERROR, // "Error during compression" CONFIGURE, // "&Configure" CONNECT, // "&Connect" + CONNECT_FAVUSER_HUB, // "Connect to hub" CONNECTED, // "Connected" CONNECTING, // "Connecting..." CONNECTING_FORCED, // "Connecting (forced)..." Modified: dcplusplus/trunk/windows/AboutDlg.h =================================================================== --- dcplusplus/trunk/windows/AboutDlg.h 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/windows/AboutDlg.h 2006-03-18 16:14:10 UTC (rev 590) @@ -41,7 +41,7 @@ _T("theparanoidone, gadget, naga, tremor, joakim tosteberg, pofis, psf8500, lauris ievins, ") _T("defr, ullner, fleetcommand, liny, xan, olle svensson, mark gillespie, jeremy huddleston, ") _T("bsod, sulan, jonathan stone, tim burton, izzzo, guitarm, paka, nils maier, jens oknelid, yoji, ") -_T("krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin, jove. ") +_T("krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin, jove, bart vullings, steven. ") _T("Keep it coming!"); class AboutDlg : public CDialogImpl<AboutDlg>, private HttpConnectionListener Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-03-18 16:14:10 UTC (rev 590) @@ -42,7 +42,6 @@ static ResourceManager::Strings columnNames[] = { ResourceManager::NICK, ResourceManager::SHARED, ResourceManager::DESCRIPTION, ResourceManager::TAG, ResourceManager::CONNECTION, ResourceManager::EMAIL }; - LRESULT HubFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP); @@ -337,32 +336,30 @@ LRESULT HubFrame::onCopyNick(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int i=-1; - if(client->isConnected()) { - string nicks; + string nicks; - while( (i = ctrlUsers.GetNextItem(i, LVNI_SELECTED)) != -1) { - nicks += (ctrlUsers.getItemData(i))->getIdentity().getNick(); - nicks += ' '; - } - if(!nicks.empty()) { - // remove last space - nicks.erase(nicks.length() - 1); - WinUtil::setClipboard(Text::toT(nicks)); - } + while( (i = ctrlUsers.GetNextItem(i, LVNI_SELECTED)) != -1) { + nicks += (ctrlUsers.getItemData(i))->getIdentity().getNick(); + nicks += ' '; } + if(!nicks.empty()) { + // remove last space + nicks.erase(nicks.length() - 1); + WinUtil::setClipboard(Text::toT(nicks)); + } return 0; } LRESULT HubFrame::onDoubleClickUsers(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { NMITEMACTIVATE* item = (NMITEMACTIVATE*)pnmh; - if(client->isConnected() && item->iItem != -1) { + if(item->iItem != -1) { ctrlUsers.getItemData(item->iItem)->getList(); } return 0; } -bool HubFrame::updateUser(const UpdateInfo& u) { +bool HubFrame::updateUser(const UserTask& u) { UserMapIter i = userMap.find(u.user); if(i == userMap.end()) { UserInfo* ui = new UserInfo(u); @@ -433,97 +430,91 @@ return needsSort; } -LRESULT HubFrame::onSpeaker(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { - if(wParam == UPDATE_USERS) { - ctrlUsers.SetRedraw(FALSE); - { - Lock l(updateCS); - for(UpdateIter i = updateList.begin(); i != updateList.end(); ++i) { - UpdateInfo& u = i->first; - switch(i->second) { - case UPDATE_USER: - if(updateUser(u)) { - if (showJoins || (favShowJoins && FavoriteManager::getInstance()->isFavoriteUser(u.user))) { - addLine(_T("*** ") + TSTRING(JOINS) + Text::toT(u.identity.getNick())); - } - } - break; - case UPDATE_USERS: - updateUser(u); - break; - case REMOVE_USER: - removeUser(u.user); - if (showJoins || (favShowJoins && FavoriteManager::getInstance()->isFavoriteUser(u.user))) { - addLine(Text::toT("*** " + STRING(PARTS) + u.identity.getNick())); - } +static const COLORREF RED = RGB(255, 0, 0); +static const COLORREF GREEN = RGB(0, 255, 0); - break; - } - } - updateList.clear(); - } +LRESULT HubFrame::onSpeaker(UINT /*uMsg*/, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /*bHandled*/) { + TaskList t; + { + Lock l(taskCS); + taskList.swap(t); + } - if(resort && showUsers) { - ctrlUsers.resort(); - resort = false; - } + ctrlUsers.SetRedraw(FALSE); - ctrlUsers.SetRedraw(TRUE); - } else if(wParam == DISCONNECTED) { - clearUserList(); - setTabColor(RGB(255, 0, 0)); - } else if(wParam == CONNECTED) { - addClientLine(TSTRING(CONNECTED)); - setTabColor(RGB(0, 255, 0)); - } else if(wParam == ADD_CHAT_LINE) { - tstring* x = (tstring*)lParam; - addLine(*x); - delete x; - } else if(wParam == ADD_STATUS_LINE) { - tstring* x = (tstring*)lParam; - addClientLine(*x); - delete x; - } else if(wParam == ADD_SILENT_STATUS_LINE) { - tstring* x = (tstring*)lParam; - addClientLine(*x, false); - delete x; - } else if(wParam == SET_WINDOW_TITLE) { - tstring* x = (tstring*)lParam; - SetWindowText(x->c_str()); - delete x; - } else if(wParam == STATS) { - ctrlStatus.SetText(1, Text::toT(Util::toString(getUserCount()) + " " + STRING(HUB_USERS)).c_str()); - ctrlStatus.SetText(2, Text::toT(Util::formatBytes(getAvailable())).c_str()); - } else if(wParam == GET_PASSWORD) { - if(client->getPassword().size() > 0) { - client->password(client->getPassword()); - addClientLine(TSTRING(STORED_PASSWORD_SENT)); - } else { - ctrlMessage.SetWindowText(_T("/password ")); - ctrlMessage.SetFocus(); - ctrlMessage.SetSel(10, 10); - waitingForPW = true; - } - } else if(wParam == PRIVATE_MESSAGE) { - PMInfo* i = (PMInfo*)lParam; - if(i->replyTo->isOnline()) { - if(BOOLSETTING(POPUP_PMS) || PrivateFrame::isOpen(i->replyTo)) { - PrivateFrame::gotMessage(i->from, i->to, i->replyTo, i->msg); + for(TaskIter i = t.begin(); i != t.end(); ++i) { + Task* task = *i; + if(task->speaker == UPDATE_USER) { + updateUser(*static_cast<UserTask*>(task)); + } else if(task->speaker == UPDATE_USER_JOIN) { + UserTask& u = *static_cast<UserTask*>(task); + if(updateUser(u)) { + if (showJoins || (favShowJoins && FavoriteManager::getInstance()->isFavoriteUser(u.user))) { + addLine(_T("*** ") + TSTRING(JOINS) + Text::toT(u.identity.getNick())); + } + } + } else if(task->speaker == REMOVE_USER) { + UserTask& u = *static_cast<UserTask*>(task); + removeUser(u.user); + if (showJoins || (favShowJoins && FavoriteManager::getInstance()->isFavoriteUser(u.user))) { + addLine(Text::toT("*** " + STRING(PARTS) + u.identity.getNick())); + } + } else if(task->speaker == CONNECTED) { + addClientLine(TSTRING(CONNECTED)); + setTabColor(GREEN); + } else if(task->speaker == DISCONNECTED) { + clearUserList(); + setTabColor(RED); + } else if(task->speaker == ADD_CHAT_LINE) { + addLine(static_cast<StringTask*>(task)->msg); + } else if(task->speaker == ADD_STATUS_LINE) { + addClientLine(static_cast<StringTask*>(task)->msg); + } else if(task->speaker == ADD_SILENT_STATUS_LINE) { + addClientLine(static_cast<StringTask*>(task)->msg, false); + } else if(task->speaker == SET_WINDOW_TITLE) { + SetWindowText(static_cast<StringTask*>(task)->msg.c_str()); + } else if(task->speaker == STATS) { + ctrlStatus.SetText(1, Text::toT(Util::toString(getUserCount()) + " " + STRING(HUB_USERS)).c_str()); + ctrlStatus.SetText(2, Text::toT(Util::formatBytes(getAvailable())).c_str()); + } else if(task->speaker == GET_PASSWORD) { + if(client->getPassword().size() > 0) { + client->password(client->getPassword()); + addClientLine(TSTRING(STORED_PASSWORD_SENT)); } else { - addLine(TSTRING(PRIVATE_MESSAGE_FROM) + getNick(i->from) + _T(": ") + i->msg); + ctrlMessage.SetWindowText(_T("/password ")); + ctrlMessage.SetFocus(); + ctrlMessage.SetSel(10, 10); + waitingForPW = true; } - } else { - if(BOOLSETTING(IGNORE_OFFLINE)) { - addClientLine(TSTRING(IGNORED_MESSAGE) + i->msg, false); - } else if(BOOLSETTING(POPUP_OFFLINE)) { - PrivateFrame::gotMessage(i->from, i->to, i->replyTo, i->msg); + } else if(task->speaker == PRIVATE_MESSAGE) { + PMTask& pm = *static_cast<PMTask*>(task); + if(pm.replyTo->isOnline()) { + if(BOOLSETTING(POPUP_PMS) || PrivateFrame::isOpen(pm.replyTo)) { + PrivateFrame::gotMessage(pm.from, pm.to, pm.replyTo, pm.msg); + } else { + addLine(TSTRING(PRIVATE_MESSAGE_FROM) + getNick(pm.from) + _T(": ") + pm.msg); + } } else { - addLine(TSTRING(PRIVATE_MESSAGE_FROM) + getNick(i->from) + _T(": ") + i->msg); + if(BOOLSETTING(IGNORE_OFFLINE)) { + addClientLine(TSTRING(IGNORED_MESSAGE) + pm.msg, false); + } else if(BOOLSETTING(POPUP_OFFLINE)) { + PrivateFrame::gotMessage(pm.from, pm.to, pm.replyTo, pm.msg); + } else { + addLine(TSTRING(PRIVATE_MESSAGE_FROM) + getNick(pm.from) + _T(": ") + pm.msg); + } } } - delete i; + + delete task; } + if(resort && showUsers) { + ctrlUsers.resort(); + resort = false; + } + + ctrlUsers.SetRedraw(TRUE); + return 0; } @@ -590,6 +581,8 @@ FavoriteManager::getInstance()->removeUserCommand(Text::fromT(server)); clearUserList(); + clearTaskList(); + WinUtil::saveHeaderOrder(ctrlUsers, SettingsManager::HUBFRAME_ORDER, SettingsManager::HUBFRAME_WIDTHS, COLUMN_LAST, columnIndexes, columnSizes); @@ -619,18 +612,19 @@ } void HubFrame::clearUserList() { - { - Lock l(updateCS); - updateList.clear(); - } - for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i) { delete i->second; } - ctrlUsers.DeleteAllItems(); userMap.clear(); + ctrlUsers.DeleteAllItems(); } +void HubFrame::clearTaskList() { + Lock l(taskCS); + for_each(taskList.begin(), taskList.end(), DeleteFunction()); + taskList.clear(); +} + LRESULT HubFrame::onLButton(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { HWND focus = GetFocus(); bHandled = false; @@ -1068,6 +1062,7 @@ client->removeListener(this); ClientManager::getInstance()->putClient(client); clearUserList(); + clearTaskList(); client = ClientManager::getInstance()->getClient(Text::fromT(server)); client->addListener(this); client->connect(); @@ -1077,7 +1072,7 @@ LRESULT HubFrame::onEnterUsers(int /*idCtrl*/, LPNMHDR /* pnmh */, BOOL& /*bHandled*/) { int item = ctrlUsers.GetNextItem(-1, LVNI_FOCUSED); - if(client->isConnected() && (item != -1)) { + if(item != -1) { try { QueueManager::getInstance()->addList((ctrlUsers.getItemData(item))->user, QueueItem::FLAG_CLIENT_VIEW); } catch(const Exception& e) { @@ -1138,7 +1133,7 @@ updateStatusBar(); if(updateUsers) { updateUsers = false; - PostMessage(WM_SPEAKER, UPDATE_USERS); + PostMessage(WM_SPEAKER); } } @@ -1153,18 +1148,15 @@ client->setPassword(Util::emptyString); } void HubFrame::on(UserUpdated, Client*, const OnlineUser& user) throw() { - speak(UPDATE_USER, user); + speak(UPDATE_USER_JOIN, user); } void HubFrame::on(UsersUpdated, Client*, const OnlineUser::List& aList) throw() { - Lock l(updateCS); - updateList.reserve(aList.size()); + Lock l(taskCS); + taskList.reserve(aList.size()); for(OnlineUser::List::const_iterator i = aList.begin(); i != aList.end(); ++i) { - if(!(*i)->getIdentity().isHidden()) - updateList.push_back(make_pair(UpdateInfo(*(*i)), UPDATE_USERS)); + taskList.push_back(new UserTask(UPDATE_USER, *(*i))); } - if(!updateList.empty()) { - PostMessage(WM_SPEAKER, UPDATE_USERS); - } + updateUsers = true; } void HubFrame::on(UserRemoved, Client*, const OnlineUser& user) throw() { @@ -1213,11 +1205,10 @@ } void HubFrame::on(PrivateMessage, Client*, const OnlineUser& from, const OnlineUser& to, const OnlineUser& replyTo, const string& line) throw() { - speak(PRIVATE_MESSAGE, from, to, replyTo, Util::toDOS("<" + from.getIdentity().getNick() + "> " + line)); + speak(from, to, replyTo, Util::toDOS("<" + from.getIdentity().getNick() + "> " + line)); } void HubFrame::on(NickTaken, Client*) throw() { speak(ADD_STATUS_LINE, STRING(NICK_TAKEN)); - speak(DISCONNECTED); } void HubFrame::on(SearchFlood, Client*, const string& line) throw() { speak(ADD_STATUS_LINE, STRING(SEARCH_SPAM_FROM) + line); Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/windows/HubFrame.h 2006-03-18 16:14:10 UTC (rev 590) @@ -132,6 +132,7 @@ LRESULT OnFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { client->disconnect(false); clearUserList(); + clearTaskList(); client->connect(); return 0; } @@ -150,7 +151,7 @@ TypedListViewCtrl<UserInfo, IDC_USERS>& getUserList() { return ctrlUsers; } private: - enum Speakers { UPDATE_USER, UPDATE_USERS, REMOVE_USER, ADD_CHAT_LINE, + enum Speakers { UPDATE_USER_JOIN, UPDATE_USER, REMOVE_USER, ADD_CHAT_LINE, ADD_STATUS_LINE, ADD_SILENT_STATUS_LINE, SET_WINDOW_TITLE, GET_PASSWORD, PRIVATE_MESSAGE, STATS, CONNECTED, DISCONNECTED }; @@ -170,18 +171,35 @@ COLUMN_LAST }; - struct UpdateInfo { - UpdateInfo() { } - UpdateInfo(const OnlineUser& ou) : user(ou.getUser()), identity(ou.getIdentity()) { } + struct Task { + Task(Speakers speaker_) : speaker(speaker_) { } + virtual ~Task() { } + Speakers speaker; + }; + struct UserTask : public Task { + UserTask(Speakers speaker_, const OnlineUser& ou) : Task(speaker_), user(ou.getUser()), identity(ou.getIdentity()) { } + User::Ptr user; Identity identity; }; + struct StringTask : public Task { + StringTask(Speakers speaker_, const tstring& msg_) : Task(speaker_), msg(msg_) { } + tstring msg; + }; + + struct PMTask : public StringTask { + PMTask(const User::Ptr& from_, const User::Ptr& to_, const User::Ptr& replyTo_, const tstring& m) : StringTask(PRIVATE_MESSAGE, m), from(from_), to(to_), replyTo(replyTo_) { } + User::Ptr from; + User::Ptr to; + User::Ptr replyTo; + }; + friend struct CompareItems; class UserInfo : public UserInfoBase, public FastAlloc<UserInfo> { public: - UserInfo(const UpdateInfo& u) : UserInfoBase(u.user) { + UserInfo(const UserTask& u) : UserInfoBase(u.user) { update(u.identity, -1); } @@ -209,14 +227,6 @@ GETSET(Identity, identity, Identity); }; - class PMInfo { - public: - PMInfo(const User::Ptr& from_, const User::Ptr& to_, const User::Ptr& replyTo_, const string& m) : from(from_), to(to_), replyTo(replyTo_), msg(Text::toT(m)) { } - User::Ptr from; - User::Ptr to; - User::Ptr replyTo; - tstring msg; - }; HubFrame(const tstring& aServer) : waitingForPW(false), extraSort(false), server(aServer), closed(false), @@ -231,11 +241,13 @@ } virtual ~HubFrame() { + ClientManager::getInstance()->putClient(client); + dcassert(frames.find(server) != frames.end()); dcassert(frames[server] == this); frames.erase(server); - ClientManager::getInstance()->putClient(client); + clearTaskList(); } typedef HASH_MAP<tstring, HubFrame*> FrameMap; @@ -272,7 +284,7 @@ if (ctrlUsers.GetSelectedCount() > 1) { return ctrlUsers.forEachSelectedT(CountAvailable()).available; } else - return client->getAvailable(); + return ctrlUsers.forEachT(CountAvailable()).available; } const tstring& getNick(const User::Ptr& u); @@ -299,14 +311,14 @@ TStringMap tabParams; bool tabMenuShown; - typedef vector<pair<UpdateInfo, Speakers> > UpdateList; - typedef UpdateList::iterator UpdateIter; + typedef vector<Task*> TaskList; + typedef TaskList::iterator TaskIter; typedef HASH_MAP<User::Ptr, UserInfo*, User::HashFunction> UserMap; typedef UserMap::iterator UserMapIter; UserMap userMap; - UpdateList updateList; - CriticalSection updateCS; + TaskList taskList; + CriticalSection taskCS; bool updateUsers; bool resort; @@ -318,7 +330,7 @@ static int columnIndexes[COLUMN_LAST]; static int columnSizes[COLUMN_LAST]; - bool updateUser(const UpdateInfo& u); + bool updateUser(const UserTask& u); void removeUser(const User::Ptr& aUser); UserInfo* findUser(const tstring& nick); @@ -327,13 +339,11 @@ void removeFavoriteHub(); void clearUserList(); + void clearTaskList(); int getImage(const Identity& u); - void updateStatusBar() { - if(m_hWnd) - PostMessage(WM_SPEAKER, STATS); - } + void updateStatusBar() { if(m_hWnd) speak(STATS); } // TimerManagerListener virtual void on(TimerManagerListener::Second, DWORD /*aTick*/) throw(); @@ -355,15 +365,10 @@ virtual void on(NickTaken, Client*) throw(); virtual void on(SearchFlood, Client*, const string&) throw(); - void speak(Speakers s) { PostMessage(WM_SPEAKER, (WPARAM)s); } - void speak(Speakers s, const string& msg) { PostMessage(WM_SPEAKER, (WPARAM)s, (LPARAM)new tstring(Text::toT(msg))); } - void speak(Speakers s, const OnlineUser& u) { - Lock l(updateCS); - updateList.push_back(make_pair(UpdateInfo(u), s)); - updateUsers = true; - } - void speak(Speakers s, const OnlineUser& from, const OnlineUser& to, const OnlineUser& replyTo, const string& line) { PostMessage(WM_SPEAKER, (WPARAM)s, (LPARAM)new PMInfo(from, to, replyTo, line)); } - + void speak(Speakers s) { Lock l(taskCS); taskList.push_back(new Task(s)); PostMessage(WM_SPEAKER); } + void speak(Speakers s, const string& msg) { Lock l(taskCS); taskList.push_back(new StringTask(s, Text::toT(msg))); PostMessage(WM_SPEAKER); } + void speak(Speakers s, const OnlineUser& u) { Lock l(taskCS); taskList.push_back(new UserTask(s, u)); updateUsers = true; } + void speak(const OnlineUser& from, const OnlineUser& to, const OnlineUser& replyTo, const string& line) { Lock l(taskCS); taskList.push_back(new PMTask(from, to, replyTo, Text::toT(line))); } }; #endif // !defined(HUB_FRAME_H) Modified: dcplusplus/trunk/windows/UsersFrame.cpp =================================================================== --- dcplusplus/trunk/windows/UsersFrame.cpp 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/windows/UsersFrame.cpp 2006-03-18 16:14:10 UTC (rev 590) @@ -27,6 +27,8 @@ #include "LineDlg.h" +#include "HubFrame.h" + int UsersFrame::columnIndexes[] = { COLUMN_NICK, COLUMN_HUB, COLUMN_SEEN, COLUMN_DESCRIPTION }; int UsersFrame::columnSizes[] = { 200, 300, 150, 200 }; static ResourceManager::Strings columnNames[] = { ResourceManager::AUTO_GRANT, ResourceManager::LAST_HUB, ResourceManager::LAST_SEEN, ResourceManager::DESCRIPTION }; @@ -147,8 +149,21 @@ FavoriteManager::getInstance()->setAutoGrant(ctrlUsers.getItemData(l->iItem)->user, ctrlUsers.GetCheckState(l->iItem) != FALSE); } return 0; -} +} +LRESULT UsersFrame::onConnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { + for(int i = 0; i < ctrlUsers.GetItemCount(); ++i) { + UserInfo *ui = ctrlUsers.getItemData(i); + FavoriteManager::FavoriteMap favUsers = FavoriteManager::getInstance()->getFavoriteUsers(); + const FavoriteUser u = favUsers.find(ui->user->getCID())->second; + if(u.getUrl().length() > 0) + { + HubFrame::openWindow(Text::toT(u.getUrl())); + } + } + return 0; +} + void UsersFrame::addUser(const FavoriteUser& aUser) { int i = ctrlUsers.insertItem(new UserInfo(aUser), 0); bool b = aUser.isSet(FavoriteUser::FLAG_GRANTSLOT); Modified: dcplusplus/trunk/windows/UsersFrame.h =================================================================== --- dcplusplus/trunk/windows/UsersFrame.h 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/windows/UsersFrame.h 2006-03-18 16:14:10 UTC (rev 590) @@ -52,6 +52,7 @@ MESSAGE_HANDLER(WM_SETFOCUS, onSetFocus) COMMAND_ID_HANDLER(IDC_REMOVE, onRemove) COMMAND_ID_HANDLER(IDC_EDIT, onEdit) + COMMAND_ID_HANDLER(IDC_CONNECT, onConnect) CHAIN_MSG_MAP(uibBase) CHAIN_MSG_MAP(baseClass) END_MSG_MAP() @@ -62,6 +63,7 @@ LRESULT onEdit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT onItemChanged(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onContextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/); + LRESULT onConnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); void UpdateLayout(BOOL bResizeBars = TRUE); Modified: dcplusplus/trunk/windows/WinUtil.h =================================================================== --- dcplusplus/trunk/windows/WinUtil.h 2006-03-17 22:57:48 UTC (rev 589) +++ dcplusplus/trunk/windows/WinUtil.h 2006-03-18 16:14:10 UTC (rev 590) @@ -125,6 +125,7 @@ menu.AppendMenu(MF_STRING, IDC_ADD_TO_FAVORITES, CTSTRING(ADD_TO_FAVORITES)); menu.AppendMenu(MF_STRING, IDC_GRANTSLOT, CTSTRING(GRANT_EXTRA_SLOT)); menu.AppendMenu(MF_STRING, IDC_REMOVEALL, CTSTRING(REMOVE_FROM_ALL)); + menu.AppendMenu(MF_STRING, IDC_CONNECT, CTSTRING(CONNECT_FAVUSER_HUB)); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-03-18 19:04:30
|
Revision: 591 Author: arnetheduck Date: 2006-03-18 11:04:20 -0800 (Sat, 18 Mar 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=591&view=rev Log Message: ----------- back/forward navigation, refactor ip getting Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/SearchFrm.cpp dcplusplus/trunk/windows/SearchFrm.h dcplusplus/trunk/windows/WinUtil.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-18 16:14:10 UTC (rev 590) +++ dcplusplus/trunk/changelog.txt 2006-03-18 19:04:20 UTC (rev 591) @@ -7,6 +7,7 @@ * Files with invalid crc-32, as per their sfv file, are no longer shared * [bug 873] Added connect to hub option (thanks joakim tosteberg) * Fixed an issue with linux file reading (thanks bart vullings and steven) +* Added back/forward mouse/keyboard navigation to directory listing frame -- 0.687 2006-02-26 -- * Fixed XML file list generation for invalid filenames from other os's Modified: dcplusplus/trunk/windows/DirectoryListingFrm.cpp =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-03-18 16:14:10 UTC (rev 590) +++ dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-03-18 19:04:20 UTC (rev 591) @@ -38,7 +38,6 @@ static ResourceManager::Strings columnNames[] = { ResourceManager::FILE, ResourceManager::TYPE, ResourceManager::EXACT_SIZE, ResourceManager::SIZE, ResourceManager::TTH_ROOT }; - DirectoryListingFrame::UserMap DirectoryListingFrame::lists; void DirectoryListingFrame::openWindow(const tstring& aFile, const User::Ptr& aUser, int64_t aSpeed) { @@ -76,7 +75,8 @@ } DirectoryListingFrame::DirectoryListingFrame(const User::Ptr& aUser, int64_t aSpeed) : - statusContainer(STATUSCLASSNAME, this, STATUS_MESSAGE_MAP), + statusContainer(STATUSCLASSNAME, this, STATUS_MESSAGE_MAP), treeContainer(WC_TREEVIEW, this, CONTROL_MESSAGE_MAP), + listContainer(WC_LISTVIEW, this, CONTROL_MESSAGE_MAP), historyIndex(0), treeRoot(NULL), skipHits(0), files(0), speed(aSpeed), updating(false), dl(new DirectoryListing(aUser)), searching(false) { lists.insert(make_pair(aUser, this)); @@ -111,7 +111,9 @@ statusContainer.SubclassWindow(ctrlStatus.m_hWnd); ctrlTree.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP, WS_EX_CLIENTEDGE, IDC_DIRECTORIES); + treeContainer.SubclassWindow(ctrlTree); ctrlList.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS, WS_EX_CLIENTEDGE, IDC_FILES); + listContainer.SubclassWindow(ctrlList); ctrlList.SetExtendedListViewStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT); ctrlList.SetBkColor(WinUtil::bgColor); @@ -295,11 +297,20 @@ if(p->itemNew.state & TVIS_SELECTED) { DirectoryListing::Directory* d = (DirectoryListing::Directory*)p->itemNew.lParam; changeDir(d, TRUE); + addHistory(dl->getPath(d)); } return 0; } +void DirectoryListingFrame::addHistory(const string& name) { + history.erase(history.begin() + historyIndex, history.end()); + while(history.size() > 25) + history.pop_front(); + history.push_back(name); + historyIndex = history.size(); +} + void DirectoryListingFrame::changeDir(DirectoryListing::Directory* d, BOOL enableRedraw) { ctrlList.SetRedraw(FALSE); @@ -328,6 +339,25 @@ } } +void DirectoryListingFrame::back() { + if(history.size() > 1 && historyIndex > 1) { + size_t n = min(historyIndex, history.size()) - 1; + deque<string> tmp = history; + selectItem(Text::toT(history[n - 1])); + historyIndex = n; + history = tmp; + } +} +void DirectoryListingFrame::forward() { + if(history.size() > 1 && historyIndex < history.size()) { + size_t n = min(historyIndex, history.size() - 1); + deque<string> tmp = history; + selectItem(Text::toT(history[n])); + historyIndex = n + 1; + history = tmp; + } +} + LRESULT DirectoryListingFrame::onDoubleClickFiles(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { NMITEMACTIVATE* item = (NMITEMACTIVATE*) pnmh; @@ -687,6 +717,18 @@ return FALSE; } +HRESULT DirectoryListingFrame::onXButtonUp(UINT /*uMsg*/, WPARAM wParam, LPARAM /* lParam */, BOOL& /* bHandled */) { + if(GET_XBUTTON_WPARAM(wParam) & XBUTTON1) { + back(); + return TRUE; + } else if(GET_XBUTTON_WPARAM(wParam) & XBUTTON2) { + forward(); + return TRUE; + } + + return FALSE; +} + LRESULT DirectoryListingFrame::onDownloadTarget(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int newId = wID - IDC_DOWNLOAD_TARGET - 1; dcassert(newId >= 0); Modified: dcplusplus/trunk/windows/DirectoryListingFrm.h =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-03-18 16:14:10 UTC (rev 590) +++ dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-03-18 19:04:20 UTC (rev 591) @@ -36,7 +36,7 @@ #include "../client/FavoriteManager.h" #define STATUS_MESSAGE_MAP 9 - +#define CONTROL_MESSAGE_MAP 10 class DirectoryListingFrame : public MDITabChildWindowImpl<DirectoryListingFrame, RGB(255, 0, 255)>, public CSplitterImpl<DirectoryListingFrame>, public UCHandler<DirectoryListingFrame> @@ -115,6 +115,8 @@ COMMAND_ID_HANDLER(IDC_NEXT, onNext) COMMAND_ID_HANDLER(IDC_MATCH_QUEUE, onMatchQueue) COMMAND_ID_HANDLER(IDC_FILELIST_DIFF, onListDiff) + ALT_MSG_MAP(CONTROL_MESSAGE_MAP) + MESSAGE_HANDLER(WM_XBUTTONUP, onXButtonUp) END_MSG_MAP() LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); @@ -132,6 +134,7 @@ LRESULT onDoubleClickFiles(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT onSelChangedDirectories(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT onContextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled); + LRESULT onXButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled); LRESULT onDownloadFavoriteDirs(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onDownloadWholeFavoriteDirs(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); @@ -226,6 +229,9 @@ HTREEITEM findFile(const StringSearch& str, HTREEITEM root, int &foundFile, int &skipHits); void updateStatus(); void initStatus(); + void addHistory(const string& name); + void back(); + void forward(); class ItemInfo : public FastAlloc<ItemInfo> { public: @@ -305,9 +311,14 @@ CMenu fileMenu; CMenu directoryMenu; CContainedWindow statusContainer; + CContainedWindow treeContainer; + CContainedWindow listContainer; StringList targets; + deque<string> history; + size_t historyIndex; + CTreeViewCtrl ctrlTree; TypedListViewCtrl<ItemInfo, IDC_FILES> ctrlList; CStatusBarCtrl ctrlStatus; Modified: dcplusplus/trunk/windows/SearchFrm.cpp =================================================================== --- dcplusplus/trunk/windows/SearchFrm.cpp 2006-03-18 16:14:10 UTC (rev 590) +++ dcplusplus/trunk/windows/SearchFrm.cpp 2006-03-18 19:04:20 UTC (rev 591) @@ -243,7 +243,7 @@ int n = ctrlHubs.GetItemCount(); for(int i = 0; i < n; i++) { if(ctrlHubs.GetCheckState(i)) { - clients.push_back(Text::fromT(ctrlHubs.getItemData(i)->ipPort)); + clients.push_back(Text::fromT(ctrlHubs.getItemData(i)->url)); } } @@ -1055,7 +1055,7 @@ if (!client->isConnected()) continue; - onHubAdded(new HubInfo(Text::toT(client->getIpPort()), Text::toT(client->getHubName()), client->getMyIdentity().isOp())); + onHubAdded(new HubInfo(Text::toT(client->getHubUrl()), Text::toT(client->getHubName()), client->getMyIdentity().isOp())); } clientMgr->unlock(); @@ -1073,7 +1073,7 @@ int nItem = 0; int n = ctrlHubs.GetItemCount(); for(; nItem < n; nItem++) { - if(ctrlHubs.getItemData(nItem)->ipPort == info->ipPort) + if(ctrlHubs.getItemData(nItem)->url == info->url) break; } if (nItem == n) @@ -1093,7 +1093,7 @@ int nItem = 0; int n = ctrlHubs.GetItemCount(); for(; nItem < n; nItem++) { - if(ctrlHubs.getItemData(nItem)->ipPort == info->ipPort) + if(ctrlHubs.getItemData(nItem)->url == info->url) break; } if (nItem == n) Modified: dcplusplus/trunk/windows/SearchFrm.h =================================================================== --- dcplusplus/trunk/windows/SearchFrm.h 2006-03-18 16:14:10 UTC (rev 590) +++ dcplusplus/trunk/windows/SearchFrm.h 2006-03-18 19:04:20 UTC (rev 591) @@ -330,7 +330,7 @@ }; struct HubInfo : public FastAlloc<HubInfo> { - HubInfo(const tstring& aIpPort, const tstring& aName, bool aOp) : ipPort(aIpPort), + HubInfo(const tstring& aUrl, const tstring& aName, bool aOp) : url(aUrl), name(aName), op(aOp) { } const tstring& getText(int col) const { @@ -339,7 +339,7 @@ static int compareItems(HubInfo* a, HubInfo* b, int col) { return (col == 0) ? lstrcmpi(a->name.c_str(), b->name.c_str()) : 0; } - tstring ipPort; + tstring url; tstring name; bool op; }; @@ -436,7 +436,7 @@ LRESULT onItemChangedHub(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); void speak(Speakers s, Client* aClient) { - HubInfo* hubInfo = new HubInfo(Text::toT(aClient->getIpPort()), Text::toT(aClient->getHubName()), aClient->getMyIdentity().isOp()); + HubInfo* hubInfo = new HubInfo(Text::toT(aClient->getHubUrl()), Text::toT(aClient->getHubName()), aClient->getMyIdentity().isOp()); PostMessage(WM_SPEAKER, WPARAM(s), LPARAM(hubInfo)); } }; Modified: dcplusplus/trunk/windows/WinUtil.h =================================================================== --- dcplusplus/trunk/windows/WinUtil.h 2006-03-18 16:14:10 UTC (rev 590) +++ dcplusplus/trunk/windows/WinUtil.h 2006-03-18 19:04:20 UTC (rev 591) @@ -335,6 +335,8 @@ SettingsManager::StrSetting widths, int n, int* indexes, int* sizes) throw(); static bool isShift() { return (GetKeyState(VK_SHIFT) & 0x8000) > 0; } + static bool isAlt() { return (GetKeyState(VK_MENU) & 0x8000) > 0; } + static bool isCtrl() { return (GetKeyState(VK_CONTROL) & 0x8000) > 0; } template<class T> static HWND hiddenCreateEx(T& p) throw() { HWND active = (HWND)::SendMessage(mdiClient, WM_MDIGETACTIVE, 0, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-03-18 19:34:29
|
Revision: 592 Author: arnetheduck Date: 2006-03-18 11:34:20 -0800 (Sat, 18 Mar 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=592&view=rev Log Message: ----------- Release preparation Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.rc dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/help/changelog.html Modified: dcplusplus/trunk/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/DCPlusPlus.rc 2006-03-18 19:04:20 UTC (rev 591) +++ dcplusplus/trunk/DCPlusPlus.rc 2006-03-18 19:34:20 UTC (rev 592) @@ -933,8 +933,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,8,7 - PRODUCTVERSION 0,6,8,7 + FILEVERSION 0,6,8,8 + PRODUCTVERSION 0,6,8,8 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -951,12 +951,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 6, 8, 7" + VALUE "FileVersion", "0, 6, 8, 8" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 6, 8, 7" + VALUE "ProductVersion", "0, 6, 8, 8" END END BLOCK "VarFileInfo" Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-03-18 19:04:20 UTC (rev 591) +++ dcplusplus/trunk/Example.xml 2006-03-18 19:34:20 UTC (rev 592) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.6875" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.688" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-18 19:04:20 UTC (rev 591) +++ dcplusplus/trunk/changelog.txt 2006-03-18 19:34:20 UTC (rev 592) @@ -1,4 +1,4 @@ --- 0.688 -- +-- 0.688 2006-02-26 -- * Fixed public hubs sorting (thanks pothead) * Fixed a ZPipe issue (thanks jove) * [bug 858] Fixed a 100% cpu / crash bug Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-03-18 19:04:20 UTC (rev 591) +++ dcplusplus/trunk/help/changelog.html 2006-03-18 19:34:20 UTC (rev 592) @@ -13,6 +13,19 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.688 <span style="color: gray;">(2006-02-26)</span></h2> +<ul> + <li>Fixed public hubs sorting (thanks pothead)</li> + <li>Fixed a ZPipe issue (thanks jove)</li> + <li>[bug 858] Fixed a 100% cpu / crash bug</li> + <li>[bug 872] Fixed a pm issue hopefully</li> + <li>[bug 812] Fixed pm's being sent to bots</li> + <li>Files with invalid crc-32, as per their sfv file, are no longer shared</li> + <li>[bug 873] Added connect to hub option (thanks joakim tosteberg)</li> + <li>Fixed an issue with linux file reading (thanks bart vullings and steven)</li> + <li>Added back/forward mouse/keyboard navigation to directory listing frame</li> +</ul> + <h2>0.687 <span style="color: gray;">(2006-02-26)</span></h2> <ul> <li>Fixed XML file list generation for invalid filenames from other os's</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-03-18 20:10:15
|
Revision: 594 Author: arnetheduck Date: 2006-03-18 12:09:56 -0800 (Sat, 18 Mar 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=594&view=rev Log Message: ----------- date fix Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/help/changelog.html Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-18 19:40:59 UTC (rev 593) +++ dcplusplus/trunk/changelog.txt 2006-03-18 20:09:56 UTC (rev 594) @@ -1,4 +1,4 @@ --- 0.688 2006-02-26 -- +-- 0.688 2006-03-18 -- * Fixed public hubs sorting (thanks pothead) * Fixed a ZPipe issue (thanks jove) * [bug 858] Fixed a 100% cpu / crash bug Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-03-18 19:40:59 UTC (rev 593) +++ dcplusplus/trunk/help/changelog.html 2006-03-18 20:09:56 UTC (rev 594) @@ -13,7 +13,7 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. -<h2>0.688 <span style="color: gray;">(2006-02-26)</span></h2> +<h2>0.688 <span style="color: gray;">(2006-03-18)</span></h2> <ul> <li>Fixed public hubs sorting (thanks pothead)</li> <li>Fixed a ZPipe issue (thanks jove)</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-04-01 18:17:34
|
Revision: 596 Author: arnetheduck Date: 2006-04-01 10:17:13 -0800 (Sat, 01 Apr 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=596&view=rev Log Message: ----------- A few fixes for the new release Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.rc dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/version.h dcplusplus/trunk/help/changelog.html dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/MainFrm.cpp Modified: dcplusplus/trunk/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/DCPlusPlus.rc 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/DCPlusPlus.rc 2006-04-01 18:17:13 UTC (rev 596) @@ -933,8 +933,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,8,8 - PRODUCTVERSION 0,6,8,8 + FILEVERSION 0,6,8,9 + PRODUCTVERSION 0,6,8,9 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -951,12 +951,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 6, 8, 8" + VALUE "FileVersion", "0, 6, 8, 9" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 6, 8, 8" + VALUE "ProductVersion", "0, 6, 8, 9" END END BLOCK "VarFileInfo" Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/Example.xml 2006-04-01 18:17:13 UTC (rev 596) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.688" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.689" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/changelog.txt 2006-04-01 18:17:13 UTC (rev 596) @@ -1,4 +1,10 @@ --- 0.688 2006-03-18 -- +-- 0.689 2006-04-01 -- +* Fixed displaying of available bytes when user list is off +* Fixed a potential crash when not showing user list +* Fixed 100% CPU bug on upload +* [bug 853] Fixed missing function in opencow + +-- 0.688 2006-03-18 -- * Fixed public hubs sorting (thanks pothead) * Fixed a ZPipe issue (thanks jove) * [bug 858] Fixed a 100% cpu / crash bug Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -309,7 +309,7 @@ fire(BufferedSocketListener::BytesSent(), 0, written); } else if(written == -1) { - if(readPos < readBuf.size()) { + if(!readDone && readPos < readBuf.size()) { // Read a little since we're blocking anyway... size_t bytesRead = min(readBuf.size() - readPos, readBuf.size() / 2); size_t actual = file->read(&readBuf[readPos], bytesRead); @@ -324,9 +324,14 @@ readPos += actual; } } else { - int w = sock->wait(POLL_TIMEOUT, Socket::WAIT_WRITE | Socket::WAIT_READ); - if(w & Socket::WAIT_READ) { - threadRead(); + while(!disconnecting) { + int w = sock->wait(POLL_TIMEOUT, Socket::WAIT_WRITE | Socket::WAIT_READ); + if(w & Socket::WAIT_READ) { + threadRead(); + } + if(w & Socket::WAIT_WRITE) { + break; + } } } } Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -399,7 +399,7 @@ if(BOOLSETTING(AUTO_SEARCH) && (aTick >= nextSearch) && (fileQueue.getSize() > 0)) { // We keep 30 recent searches to avoid duplicate searches - while((recent.size() > fileQueue.getSize()) || (recent.size() > 30)) { + while((recent.size() >= fileQueue.getSize()) || (recent.size() > 30)) { recent.erase(recent.begin()); } Modified: dcplusplus/trunk/client/version.h =================================================================== --- dcplusplus/trunk/client/version.h 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/client/version.h 2006-04-01 18:17:13 UTC (rev 596) @@ -17,8 +17,8 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.688" -#define VERSIONFLOAT 0.688 +#define VERSIONSTRING "0.689" +#define VERSIONFLOAT 0.689 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/help/changelog.html 2006-04-01 18:17:13 UTC (rev 596) @@ -13,6 +13,14 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.689 <span style="color: gray;">(2006-04-01)</span></h2> +<ul> + <li>Fixed displaying of available bytes when user list is off</li> + <li>Fixed a potential crash when not showing user list</li> + <li>Fixed 100% CPU bug on upload</li> + <li>[bug 853] Fixed missing function in opencow</li> +</ul> + <h2>0.688 <span style="color: gray;">(2006-03-18)</span></h2> <ul> <li>Fixed public hubs sorting (thanks pothead)</li> Modified: dcplusplus/trunk/windows/DirectoryListingFrm.cpp =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -339,6 +339,16 @@ } } +void DirectoryListingFrame::up() { + HTREEITEM t = ctrlTree.GetSelectedItem(); + if(t == NULL) + return; + t = ctrlTree.GetParentItem(t); + if(t == NULL) + return; + ctrlTree.SelectItem(t); +} + void DirectoryListingFrame::back() { if(history.size() > 1 && historyIndex > 1) { size_t n = min(historyIndex, history.size()) - 1; @@ -829,15 +839,13 @@ LRESULT DirectoryListingFrame::onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { NMLVKEYDOWN* kd = (NMLVKEYDOWN*) pnmh; if(kd->wVKey == VK_BACK) { - HTREEITEM cur = ctrlTree.GetSelectedItem(); - if(cur != NULL) - { - HTREEITEM parent = ctrlTree.GetParentItem(cur); - if(parent != NULL) - ctrlTree.SelectItem(parent); - } + up(); } else if(kd->wVKey == VK_TAB) { onTab(); + } else if(kd->wVKey == VK_LEFT && WinUtil::isAlt()) { + back(); + } else if(kd->wVKey == VK_RIGHT && WinUtil::isAlt()) { + forward(); } else if(kd->wVKey == VK_RETURN) { if(ctrlList.GetSelectedCount() == 1) { ItemInfo* ii = (ItemInfo*)ctrlList.GetItemData(ctrlList.GetNextItem(-1, LVNI_SELECTED)); Modified: dcplusplus/trunk/windows/DirectoryListingFrm.h =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-04-01 18:17:13 UTC (rev 596) @@ -230,6 +230,7 @@ void updateStatus(); void initStatus(); void addHistory(const string& name); + void up(); void back(); void forward(); Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -612,11 +612,11 @@ } void HubFrame::clearUserList() { + ctrlUsers.DeleteAllItems(); for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i) { delete i->second; } userMap.clear(); - ctrlUsers.DeleteAllItems(); } void HubFrame::clearTaskList() { @@ -907,6 +907,14 @@ } } +LRESULT HubFrame::onFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { + client->disconnect(false); + clearUserList(); + clearTaskList(); + client->connect(); + return 0; +} + LRESULT HubFrame::onChar(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) { if(!complete.empty() && wParam != VK_TAB && uMsg == WM_KEYDOWN) complete.clear(); @@ -1037,6 +1045,7 @@ ctrlUsers.resort(); } else { showUsers = false; + ctrlUsers.DeleteAllItems(); } SettingsManager::getInstance()->set(SettingsManager::GET_USER_INFO, showUsers); Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/HubFrame.h 2006-04-01 18:17:13 UTC (rev 596) @@ -56,6 +56,7 @@ NOTIFY_HANDLER(IDC_USERS, NM_DBLCLK, onDoubleClickUsers) NOTIFY_HANDLER(IDC_USERS, LVN_KEYDOWN, onKeyDownUsers) NOTIFY_HANDLER(IDC_USERS, NM_RETURN, onEnterUsers) + NOTIFY_HANDLER(IDC_USERS, LVN_ITEMCHANGED, onItemChanged) NOTIFY_CODE_HANDLER(TTN_GETDISPINFO, onGetToolTip) MESSAGE_HANDLER(WM_CLOSE, onClose) MESSAGE_HANDLER(WM_SETFOCUS, onSetFocus) @@ -65,7 +66,7 @@ MESSAGE_HANDLER(WM_CTLCOLORSTATIC, onCtlColor) MESSAGE_HANDLER(WM_CTLCOLOREDIT, onCtlColor) MESSAGE_HANDLER(FTM_CONTEXTMENU, onTabContextMenu) - COMMAND_ID_HANDLER(ID_FILE_RECONNECT, OnFileReconnect) + COMMAND_ID_HANDLER(ID_FILE_RECONNECT, onFileReconnect) COMMAND_ID_HANDLER(IDC_FOLLOW, onFollow) COMMAND_ID_HANDLER(IDC_SEND_MESSAGE, onSendMessage) COMMAND_ID_HANDLER(IDC_ADD_AS_FAVORITE, onAddAsFavorite) @@ -98,6 +99,7 @@ LRESULT onEnterUsers(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onGetToolTip(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onCtlColor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); + LRESULT onFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); void UpdateLayout(BOOL bResizeBars = TRUE); void addLine(const tstring& aLine); @@ -129,11 +131,8 @@ return 0; } - LRESULT OnFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - client->disconnect(false); - clearUserList(); - clearTaskList(); - client->connect(); + LRESULT onItemChanged(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) { + updateStatusBar(); return 0; } @@ -150,7 +149,6 @@ public: TypedListViewCtrl<UserInfo, IDC_USERS>& getUserList() { return ctrlUsers; } private: - enum Speakers { UPDATE_USER_JOIN, UPDATE_USER, REMOVE_USER, ADD_CHAT_LINE, ADD_STATUS_LINE, ADD_SILENT_STATUS_LINE, SET_WINDOW_TITLE, GET_PASSWORD, PRIVATE_MESSAGE, STATS, CONNECTED, DISCONNECTED @@ -254,6 +252,11 @@ typedef FrameMap::iterator FrameIter; static FrameMap frames; + typedef vector<Task*> TaskList; + typedef TaskList::iterator TaskIter; + typedef HASH_MAP<User::Ptr, UserInfo*, User::HashFunction> UserMap; + typedef UserMap::iterator UserMapIter; + tstring redirect; bool timeStamps; bool showJoins; @@ -273,18 +276,21 @@ void operator()(UserInfo *ui) { available += ui->getIdentity().getBytesShared(); } + void operator()(UserMap::const_reference ui) { + available += ui.second->getIdentity().getBytesShared(); + } }; size_t getUserCount() const { size_t sel = ctrlUsers.GetSelectedCount(); - return sel > 1 ? sel : client->getUserCount(); + return sel > 1 ? sel : userMap.size(); } int64_t getAvailable() { if (ctrlUsers.GetSelectedCount() > 1) { return ctrlUsers.forEachSelectedT(CountAvailable()).available; } else - return ctrlUsers.forEachT(CountAvailable()).available; + return for_each(userMap.begin(), userMap.end(), CountAvailable()).available; } const tstring& getNick(const User::Ptr& u); @@ -311,11 +317,6 @@ TStringMap tabParams; bool tabMenuShown; - typedef vector<Task*> TaskList; - typedef TaskList::iterator TaskIter; - typedef HASH_MAP<User::Ptr, UserInfo*, User::HashFunction> UserMap; - typedef UserMap::iterator UserMapIter; - UserMap userMap; TaskList taskList; CriticalSection taskCS; Modified: dcplusplus/trunk/windows/MainFrm.cpp =================================================================== --- dcplusplus/trunk/windows/MainFrm.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/MainFrm.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -103,7 +103,9 @@ WinUtil::init(m_hWnd); - trayMessage = RegisterWindowMessage(_T("TaskbarCreated")); + //trayMessage = RegisterWindowMessage(_T("TaskbarCreated")); + // Use ASCII version as opencow doesn't support the wide one... + trayMessage = RegisterWindowMessageA("TaskbarCreated"); TimerManager::getInstance()->start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-04-30 09:34:36
|
Revision: 598 Author: arnetheduck Date: 2006-04-30 02:27:55 -0700 (Sun, 30 Apr 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=598&view=rev Log Message: ----------- New copyright, fixed some annoying crash bugs Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/ADLSearch.cpp dcplusplus/trunk/client/ADLSearch.h dcplusplus/trunk/client/AdcCommand.cpp dcplusplus/trunk/client/AdcCommand.h dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/AdcHub.h dcplusplus/trunk/client/BZUtils.cpp dcplusplus/trunk/client/BZUtils.h dcplusplus/trunk/client/BitInputStream.h dcplusplus/trunk/client/BitOutputStream.h dcplusplus/trunk/client/BloomFilter.h dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/BufferedSocket.h dcplusplus/trunk/client/CID.h dcplusplus/trunk/client/Client.cpp dcplusplus/trunk/client/Client.h dcplusplus/trunk/client/ClientManager.cpp dcplusplus/trunk/client/ClientManager.h dcplusplus/trunk/client/ClientManagerListener.h dcplusplus/trunk/client/ConnectionManager.cpp dcplusplus/trunk/client/ConnectionManager.h dcplusplus/trunk/client/ConnectionManagerListener.h dcplusplus/trunk/client/CriticalSection.h dcplusplus/trunk/client/CryptoManager.cpp dcplusplus/trunk/client/CryptoManager.h dcplusplus/trunk/client/DCPlusPlus.cpp dcplusplus/trunk/client/DCPlusPlus.h dcplusplus/trunk/client/DirectoryListing.cpp dcplusplus/trunk/client/DirectoryListing.h dcplusplus/trunk/client/DownloadManager.cpp dcplusplus/trunk/client/DownloadManager.h dcplusplus/trunk/client/Encoder.cpp dcplusplus/trunk/client/Encoder.h dcplusplus/trunk/client/Exception.h dcplusplus/trunk/client/FastAlloc.h dcplusplus/trunk/client/FavoriteManager.cpp dcplusplus/trunk/client/FavoriteManager.h dcplusplus/trunk/client/FavoriteUser.h dcplusplus/trunk/client/File.h dcplusplus/trunk/client/FilteredFile.h dcplusplus/trunk/client/FinishedManager.cpp dcplusplus/trunk/client/FinishedManager.h dcplusplus/trunk/client/HashManager.cpp dcplusplus/trunk/client/HashManager.h dcplusplus/trunk/client/HashValue.h dcplusplus/trunk/client/HttpConnection.cpp dcplusplus/trunk/client/HttpConnection.h dcplusplus/trunk/client/LogManager.cpp dcplusplus/trunk/client/LogManager.h dcplusplus/trunk/client/MerkleCheckOutputStream.h dcplusplus/trunk/client/MerkleTree.h dcplusplus/trunk/client/NmdcHub.h dcplusplus/trunk/client/Pointer.h dcplusplus/trunk/client/QueueItem.h dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/QueueManager.h dcplusplus/trunk/client/QueueManagerListener.h dcplusplus/trunk/client/ResourceManager.cpp dcplusplus/trunk/client/ResourceManager.h dcplusplus/trunk/client/SFVReader.cpp dcplusplus/trunk/client/SFVReader.h dcplusplus/trunk/client/SSLSocket.cpp dcplusplus/trunk/client/SSLSocket.h dcplusplus/trunk/client/SearchManager.cpp dcplusplus/trunk/client/SearchManager.h dcplusplus/trunk/client/SearchManagerListener.h dcplusplus/trunk/client/Semaphore.h dcplusplus/trunk/client/ServerSocket.cpp dcplusplus/trunk/client/ServerSocket.h dcplusplus/trunk/client/SettingsManager.cpp dcplusplus/trunk/client/SettingsManager.h dcplusplus/trunk/client/ShareManager.cpp dcplusplus/trunk/client/ShareManager.h dcplusplus/trunk/client/SimpleXML.cpp dcplusplus/trunk/client/SimpleXML.h dcplusplus/trunk/client/Singleton.h dcplusplus/trunk/client/Socket.cpp dcplusplus/trunk/client/Socket.h dcplusplus/trunk/client/Speaker.h dcplusplus/trunk/client/Streams.h dcplusplus/trunk/client/StringSearch.h dcplusplus/trunk/client/StringTokenizer.cpp dcplusplus/trunk/client/StringTokenizer.h dcplusplus/trunk/client/Text.cpp dcplusplus/trunk/client/Text.h dcplusplus/trunk/client/Thread.cpp dcplusplus/trunk/client/Thread.h dcplusplus/trunk/client/TigerHash.cpp dcplusplus/trunk/client/TigerHash.h dcplusplus/trunk/client/TimerManager.cpp dcplusplus/trunk/client/TimerManager.h dcplusplus/trunk/client/UploadManager.cpp dcplusplus/trunk/client/UploadManager.h dcplusplus/trunk/client/User.cpp dcplusplus/trunk/client/User.h dcplusplus/trunk/client/UserCommand.h dcplusplus/trunk/client/UserConnection.cpp dcplusplus/trunk/client/UserConnection.h dcplusplus/trunk/client/Util.cpp dcplusplus/trunk/client/Util.h dcplusplus/trunk/client/ZUtils.cpp dcplusplus/trunk/client/ZUtils.h dcplusplus/trunk/client/config.h dcplusplus/trunk/client/stdinc.cpp dcplusplus/trunk/client/stdinc.h dcplusplus/trunk/help/faq_upnp.html dcplusplus/trunk/windows/ADLSProperties.cpp dcplusplus/trunk/windows/ADLSProperties.h dcplusplus/trunk/windows/ADLSearchFrame.cpp dcplusplus/trunk/windows/ADLSearchFrame.h dcplusplus/trunk/windows/AboutDlg.h dcplusplus/trunk/windows/Advanced3Page.cpp dcplusplus/trunk/windows/Advanced3Page.h dcplusplus/trunk/windows/AdvancedPage.cpp dcplusplus/trunk/windows/AdvancedPage.h dcplusplus/trunk/windows/Appearance2Page.cpp dcplusplus/trunk/windows/Appearance2Page.h dcplusplus/trunk/windows/AppearancePage.cpp dcplusplus/trunk/windows/AppearancePage.h dcplusplus/trunk/windows/CertificatesPage.cpp dcplusplus/trunk/windows/CertificatesPage.h dcplusplus/trunk/windows/CommandDlg.cpp dcplusplus/trunk/windows/CommandDlg.h dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/DownloadPage.cpp dcplusplus/trunk/windows/DownloadPage.h dcplusplus/trunk/windows/ExListViewCtrl.cpp dcplusplus/trunk/windows/ExListViewCtrl.h dcplusplus/trunk/windows/FavHubProperties.cpp dcplusplus/trunk/windows/FavHubProperties.h dcplusplus/trunk/windows/FavoriteDirsPage.cpp dcplusplus/trunk/windows/FavoriteDirsPage.h dcplusplus/trunk/windows/FavoritesFrm.cpp dcplusplus/trunk/windows/FavoritesFrm.h dcplusplus/trunk/windows/FinishedFrame.h dcplusplus/trunk/windows/FinishedFrameBase.h dcplusplus/trunk/windows/FinishedULFrame.h dcplusplus/trunk/windows/FlatTabCtrl.h dcplusplus/trunk/windows/GeneralPage.cpp dcplusplus/trunk/windows/GeneralPage.h dcplusplus/trunk/windows/HashProgressDlg.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/LineDlg.h dcplusplus/trunk/windows/ListViewArrows.h dcplusplus/trunk/windows/LogPage.cpp dcplusplus/trunk/windows/LogPage.h dcplusplus/trunk/windows/MagnetDlg.h dcplusplus/trunk/windows/MainFrm.cpp dcplusplus/trunk/windows/MainFrm.h dcplusplus/trunk/windows/NetworkPage.cpp dcplusplus/trunk/windows/NetworkPage.h dcplusplus/trunk/windows/NotepadFrame.cpp dcplusplus/trunk/windows/NotepadFrame.h dcplusplus/trunk/windows/PrivateFrame.cpp dcplusplus/trunk/windows/PrivateFrame.h dcplusplus/trunk/windows/PropPage.cpp dcplusplus/trunk/windows/PropPage.h dcplusplus/trunk/windows/PropertiesDlg.cpp dcplusplus/trunk/windows/PropertiesDlg.h dcplusplus/trunk/windows/PublicHubsFrm.cpp dcplusplus/trunk/windows/PublicHubsFrm.h dcplusplus/trunk/windows/PublicHubsListDlg.h dcplusplus/trunk/windows/QueueFrame.cpp dcplusplus/trunk/windows/QueueFrame.h dcplusplus/trunk/windows/QueuePage.cpp dcplusplus/trunk/windows/QueuePage.h dcplusplus/trunk/windows/SearchFrm.cpp dcplusplus/trunk/windows/SearchFrm.h dcplusplus/trunk/windows/SingleInstance.h dcplusplus/trunk/windows/SpyFrame.cpp dcplusplus/trunk/windows/SpyFrame.h dcplusplus/trunk/windows/StatsFrame.cpp dcplusplus/trunk/windows/StatsFrame.h dcplusplus/trunk/windows/SystemFrame.cpp dcplusplus/trunk/windows/SystemFrame.h dcplusplus/trunk/windows/TextFrame.cpp dcplusplus/trunk/windows/TextFrame.h dcplusplus/trunk/windows/TransferView.cpp dcplusplus/trunk/windows/TransferView.h dcplusplus/trunk/windows/TreePropertySheet.cpp dcplusplus/trunk/windows/TreePropertySheet.h dcplusplus/trunk/windows/TypedListViewCtrl.h dcplusplus/trunk/windows/UCHandler.h dcplusplus/trunk/windows/UCPage.cpp dcplusplus/trunk/windows/UCPage.h dcplusplus/trunk/windows/UPnP.cpp dcplusplus/trunk/windows/UPnP.h dcplusplus/trunk/windows/UploadPage.cpp dcplusplus/trunk/windows/UploadPage.h dcplusplus/trunk/windows/UsersFrame.cpp dcplusplus/trunk/windows/UsersFrame.h dcplusplus/trunk/windows/WaitingUsersFrame.cpp dcplusplus/trunk/windows/WaitingUsersFrame.h dcplusplus/trunk/windows/WinUtil.cpp dcplusplus/trunk/windows/WinUtil.h dcplusplus/trunk/windows/WindowsPage.cpp dcplusplus/trunk/windows/WindowsPage.h dcplusplus/trunk/windows/main.cpp dcplusplus/trunk/windows/stdafx.cpp dcplusplus/trunk/windows/stdafx.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/changelog.txt 2006-04-30 09:27:55 UTC (rev 598) @@ -1,4 +1,11 @@ --- 0.689 2006-04-01 -- +-- -- +* Small linux / old gcc fixes (thanks jens oknelid) +* Fixed an issue where client could be crashed from remote +* Fixed an issue bad nicks could cause directories to be created in log / file list download folder +* Changed autodrop default to 2 for fewer unexpected autodrops (thanks paka) + + +-- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off * Fixed a potential crash when not showing user list * Fixed 100% CPU bug on upload Modified: dcplusplus/trunk/client/ADLSearch.cpp =================================================================== --- dcplusplus/trunk/client/ADLSearch.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ADLSearch.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ADLSearch.h =================================================================== --- dcplusplus/trunk/client/ADLSearch.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ADLSearch.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ stringSearchList.clear(); // Replace parameters such as %[nick] - string stringParams = Util::formatParams(searchString, params); + string stringParams = Util::formatParams(searchString, params, false); // Split into substrings StringTokenizer<string> st(stringParams, ' '); Modified: dcplusplus/trunk/client/AdcCommand.cpp =================================================================== --- dcplusplus/trunk/client/AdcCommand.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/AdcCommand.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/AdcCommand.h =================================================================== --- dcplusplus/trunk/client/AdcCommand.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/AdcCommand.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/AdcHub.h =================================================================== --- dcplusplus/trunk/client/AdcHub.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/AdcHub.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BZUtils.cpp =================================================================== --- dcplusplus/trunk/client/BZUtils.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BZUtils.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BZUtils.h =================================================================== --- dcplusplus/trunk/client/BZUtils.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BZUtils.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BitInputStream.h =================================================================== --- dcplusplus/trunk/client/BitInputStream.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BitInputStream.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BitOutputStream.h =================================================================== --- dcplusplus/trunk/client/BitOutputStream.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BitOutputStream.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BloomFilter.h =================================================================== --- dcplusplus/trunk/client/BloomFilter.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BloomFilter.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/BufferedSocket.h =================================================================== --- dcplusplus/trunk/client/BufferedSocket.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/BufferedSocket.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/CID.h =================================================================== --- dcplusplus/trunk/client/CID.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/CID.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Client.cpp =================================================================== --- dcplusplus/trunk/client/Client.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Client.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Client.h =================================================================== --- dcplusplus/trunk/client/Client.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Client.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ClientManager.cpp =================================================================== --- dcplusplus/trunk/client/ClientManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ClientManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -391,7 +391,7 @@ ou.getClient().getHubIdentity().getParams(params, "hub", false); ou.getClient().getMyIdentity().getParams(params, "my", compatibility); ou.getClient().escapeParams(params); - ou.getClient().sendUserCmd(Util::formatParams(uc.getCommand(), params)); + ou.getClient().sendUserCmd(Util::formatParams(uc.getCommand(), params, false)); } void ClientManager::on(AdcSearch, Client*, const AdcCommand& adc, const CID& from) throw() { Modified: dcplusplus/trunk/client/ClientManager.h =================================================================== --- dcplusplus/trunk/client/ClientManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ClientManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ClientManagerListener.h =================================================================== --- dcplusplus/trunk/client/ClientManagerListener.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ClientManagerListener.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ConnectionManager.cpp =================================================================== --- dcplusplus/trunk/client/ConnectionManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ConnectionManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -691,8 +691,9 @@ } else if(*i == UserConnection::FEATURE_TTHL) { conn->setFlag(UserConnection::FLAG_SUPPORTS_TTHL); } else if(*i == UserConnection::FEATURE_TTHF) { - conn->setFlag(UserConnection::FLAG_SUPPORTS_TTHF); - conn->getUser()->setFlag(User::TTH_GET); + conn->setFlag(UserConnection::FLAG_SUPPORTS_TTHF); + if(conn->getUser()) + conn->getUser()->setFlag(User::TTH_GET); } } } Modified: dcplusplus/trunk/client/ConnectionManager.h =================================================================== --- dcplusplus/trunk/client/ConnectionManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ConnectionManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ConnectionManagerListener.h =================================================================== --- dcplusplus/trunk/client/ConnectionManagerListener.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ConnectionManagerListener.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/CriticalSection.h =================================================================== --- dcplusplus/trunk/client/CriticalSection.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/CriticalSection.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/CryptoManager.cpp =================================================================== --- dcplusplus/trunk/client/CryptoManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/CryptoManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/CryptoManager.h =================================================================== --- dcplusplus/trunk/client/CryptoManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/CryptoManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/DCPlusPlus.cpp =================================================================== --- dcplusplus/trunk/client/DCPlusPlus.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/DCPlusPlus.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/DCPlusPlus.h =================================================================== --- dcplusplus/trunk/client/DCPlusPlus.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/DCPlusPlus.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/DirectoryListing.cpp =================================================================== --- dcplusplus/trunk/client/DirectoryListing.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/DirectoryListing.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/DirectoryListing.h =================================================================== --- dcplusplus/trunk/client/DirectoryListing.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/DirectoryListing.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/client/DownloadManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/DownloadManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/DownloadManager.h =================================================================== --- dcplusplus/trunk/client/DownloadManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/DownloadManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Encoder.cpp =================================================================== --- dcplusplus/trunk/client/Encoder.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Encoder.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Encoder.h =================================================================== --- dcplusplus/trunk/client/Encoder.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Encoder.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Exception.h =================================================================== --- dcplusplus/trunk/client/Exception.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Exception.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FastAlloc.h =================================================================== --- dcplusplus/trunk/client/FastAlloc.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FastAlloc.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FavoriteManager.cpp =================================================================== --- dcplusplus/trunk/client/FavoriteManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FavoriteManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FavoriteManager.h =================================================================== --- dcplusplus/trunk/client/FavoriteManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FavoriteManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FavoriteUser.h =================================================================== --- dcplusplus/trunk/client/FavoriteUser.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FavoriteUser.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/File.h =================================================================== --- dcplusplus/trunk/client/File.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/File.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FilteredFile.h =================================================================== --- dcplusplus/trunk/client/FilteredFile.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FilteredFile.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FinishedManager.cpp =================================================================== --- dcplusplus/trunk/client/FinishedManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FinishedManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/FinishedManager.h =================================================================== --- dcplusplus/trunk/client/FinishedManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/FinishedManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/HashManager.cpp =================================================================== --- dcplusplus/trunk/client/HashManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/HashManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ #define HASH_FILE_VERSION_STRING "2" static const u_int32_t HASH_FILE_VERSION=2; +const int64_t HashManager::MIN_BLOCK_SIZE = 64*1024; bool HashManager::checkTTH(const string& aFileName, int64_t aSize, u_int32_t aTimeStamp) { Lock l(cs); Modified: dcplusplus/trunk/client/HashManager.h =================================================================== --- dcplusplus/trunk/client/HashManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/HashManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ public: /** We don't keep leaves for blocks smaller than this... */ - static const int64_t MIN_BLOCK_SIZE = 64*1024; + static const int64_t MIN_BLOCK_SIZE; HashManager() { TimerManager::getInstance()->addListener(this); Modified: dcplusplus/trunk/client/HashValue.h =================================================================== --- dcplusplus/trunk/client/HashValue.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/HashValue.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/HttpConnection.cpp =================================================================== --- dcplusplus/trunk/client/HttpConnection.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/HttpConnection.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/HttpConnection.h =================================================================== --- dcplusplus/trunk/client/HttpConnection.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/HttpConnection.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/LogManager.cpp =================================================================== --- dcplusplus/trunk/client/LogManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/LogManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/LogManager.h =================================================================== --- dcplusplus/trunk/client/LogManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/LogManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,8 +47,8 @@ string path = SETTING(LOG_DIRECTORY); string msg; - path += Util::formatParams(getSetting(area, FILE), params); - msg = Util::formatParams(getSetting(area, FORMAT), params); + path += Util::formatParams(getSetting(area, FILE), params, true); + msg = Util::formatParams(getSetting(area, FORMAT), params, false); log(path, msg); } Modified: dcplusplus/trunk/client/MerkleCheckOutputStream.h =================================================================== --- dcplusplus/trunk/client/MerkleCheckOutputStream.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/MerkleCheckOutputStream.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/MerkleTree.h =================================================================== --- dcplusplus/trunk/client/MerkleTree.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/MerkleTree.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/NmdcHub.h =================================================================== --- dcplusplus/trunk/client/NmdcHub.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/NmdcHub.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Pointer.h =================================================================== --- dcplusplus/trunk/client/Pointer.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Pointer.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/QueueItem.h =================================================================== --- dcplusplus/trunk/client/QueueItem.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/QueueItem.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,7 +81,7 @@ sm["targetdrive"] = target.substr(0, 3); else sm["targetdrive"] = Util::getConfigPath().substr(0, 3); - setTempTarget(Util::formatParams(SETTING(TEMP_DOWNLOAD_DIRECTORY), sm) + getTempName(getTargetFileName(), getTTH())); + setTempTarget(Util::formatParams(SETTING(TEMP_DOWNLOAD_DIRECTORY), sm, true) + getTempName(getTargetFileName(), getTTH())); #else //_WIN32 setTempTarget(SETTING(TEMP_DOWNLOAD_DIRECTORY) + getTempName(getTargetFileName(), getTTH())); #endif //_WIN32 Modified: dcplusplus/trunk/client/QueueManager.h =================================================================== --- dcplusplus/trunk/client/QueueManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/QueueManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/QueueManagerListener.h =================================================================== --- dcplusplus/trunk/client/QueueManagerListener.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/QueueManagerListener.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ResourceManager.cpp =================================================================== --- dcplusplus/trunk/client/ResourceManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ResourceManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ResourceManager.h =================================================================== --- dcplusplus/trunk/client/ResourceManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ResourceManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SFVReader.cpp =================================================================== --- dcplusplus/trunk/client/SFVReader.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SFVReader.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SFVReader.h =================================================================== --- dcplusplus/trunk/client/SFVReader.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SFVReader.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SSLSocket.cpp =================================================================== --- dcplusplus/trunk/client/SSLSocket.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SSLSocket.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SSLSocket.h =================================================================== --- dcplusplus/trunk/client/SSLSocket.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SSLSocket.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SearchManager.cpp =================================================================== --- dcplusplus/trunk/client/SearchManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SearchManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SearchManager.h =================================================================== --- dcplusplus/trunk/client/SearchManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SearchManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SearchManagerListener.h =================================================================== --- dcplusplus/trunk/client/SearchManagerListener.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SearchManagerListener.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Semaphore.h =================================================================== --- dcplusplus/trunk/client/Semaphore.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Semaphore.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ServerSocket.cpp =================================================================== --- dcplusplus/trunk/client/ServerSocket.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ServerSocket.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ServerSocket.h =================================================================== --- dcplusplus/trunk/client/ServerSocket.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ServerSocket.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/client/SettingsManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SettingsManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -220,7 +220,7 @@ setDefault(AUTODROP_INTERVAL, 10); setDefault(AUTODROP_ELAPSED, 15); setDefault(AUTODROP_INACTIVITY, 10); - setDefault(AUTODROP_MINSOURCES, 1); + setDefault(AUTODROP_MINSOURCES, 2); setDefault(AUTODROP_FILESIZE, 0); setDefault(AUTODROP_ALL, false); setDefault(AUTODROP_FILELISTS, false); Modified: dcplusplus/trunk/client/SettingsManager.h =================================================================== --- dcplusplus/trunk/client/SettingsManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SettingsManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ShareManager.cpp =================================================================== --- dcplusplus/trunk/client/ShareManager.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ShareManager.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/ShareManager.h =================================================================== --- dcplusplus/trunk/client/ShareManager.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/ShareManager.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SimpleXML.cpp =================================================================== --- dcplusplus/trunk/client/SimpleXML.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SimpleXML.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/SimpleXML.h =================================================================== --- dcplusplus/trunk/client/SimpleXML.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/SimpleXML.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Singleton.h =================================================================== --- dcplusplus/trunk/client/Singleton.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Singleton.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Socket.cpp =================================================================== --- dcplusplus/trunk/client/Socket.cpp 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Socket.cpp 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Socket.h =================================================================== --- dcplusplus/trunk/client/Socket.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Socket.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,9 +154,9 @@ void setBlocking(bool block) throw() { int flags = fcntl(sock, F_GETFL, 0); if(block) { + fcntl(sock, F_SETFL, flags & (~O_NONBLOCK)); + } else { fcntl(sock, F_SETFL, flags | O_NONBLOCK); - } else { - fcntl(sock, F_SETFL, flags & (~O_NONBLOCK)); } blocking = block; } @@ -233,7 +233,7 @@ static int check(int ret, bool blockOk = false) { if(ret == -1) { int error = getLastError(); - if(blockOk && (error == EWOULDBLOCK || error == ENOBUFS) ) { + if(blockOk && (error == EWOULDBLOCK || error == ENOBUFS || error == EINPROGRESS) ) { return -1; } else { throw SocketException(error); Modified: dcplusplus/trunk/client/Speaker.h =================================================================== --- dcplusplus/trunk/client/Speaker.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Speaker.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/Streams.h =================================================================== --- dcplusplus/trunk/client/Streams.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/Streams.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: dcplusplus/trunk/client/StringSearch.h =================================================================== --- dcplusplus/trunk/client/StringSearch.h 2006-04-01 18:26:49 UTC (rev 597) +++ dcplusplus/trunk/client/StringSearch.h 2006-04-30 09:27:55 UTC (rev 598) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C)... [truncated message content] |
From: <arn...@us...> - 2006-04-30 11:10:19
|
Revision: 599 Author: arnetheduck Date: 2006-04-30 04:09:50 -0700 (Sun, 30 Apr 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=599&view=rev Log Message: ----------- CID display added here and there (in frames, when nick missing) Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/ClientManager.cpp dcplusplus/trunk/client/ClientManager.h dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/StringDefs.h dcplusplus/trunk/windows/FinishedFrame.cpp dcplusplus/trunk/windows/FinishedULFrame.cpp dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/SearchFrm.cpp dcplusplus/trunk/windows/SearchFrm.h dcplusplus/trunk/windows/TransferView.cpp dcplusplus/trunk/windows/TransferView.h dcplusplus/trunk/windows/UsersFrame.cpp dcplusplus/trunk/windows/UsersFrame.h Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/Example.xml 2006-04-30 11:09:50 UTC (rev 599) @@ -41,6 +41,7 @@ <String Name="BrowseAccel">&Browse...</String> <String Name="BrowseFileList">Browse file list</String> <String Name="ChooseFolder">Choose folder</String> + <String Name="Cid">CID</String> <String Name="Close">Close</String> <String Name="CloseConnection">Close connection</String> <String Name="ClosingConnection">Closing connection...</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/changelog.txt 2006-04-30 11:09:50 UTC (rev 599) @@ -3,8 +3,10 @@ * Fixed an issue where client could be crashed from remote * Fixed an issue bad nicks could cause directories to be created in log / file list download folder * Changed autodrop default to 2 for fewer unexpected autodrops (thanks paka) +* Saved users file more often to have fewer missing nicks around +* CID of user shown if nick is missing (in queue for example) +* Added display of CID in a few places - -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off * Fixed a potential crash when not showing user list Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -269,7 +269,7 @@ size_t readPos = 0; bool readDone = false; - dcdebug("Starting threadSend"); + dcdebug("Starting threadSend\n"); while(true) { if(!readDone && readBuf.size() > readPos) { // Fill read buffer Modified: dcplusplus/trunk/client/ClientManager.cpp =================================================================== --- dcplusplus/trunk/client/ClientManager.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/client/ClientManager.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -112,10 +112,11 @@ if(lst.empty()) { // Offline perhaps? UserIter i = users.find(cid); - if(i != users.end()) + if(i != users.end() && !i->second->getFirstNick().empty()) { lst.push_back(i->second->getFirstNick()); - else + } else { lst.push_back('{' + cid.toBase32() + '}'); + } } return lst; } @@ -452,7 +453,7 @@ } } -void ClientManager::on(Save, SimpleXML*) throw() { +void ClientManager::save() { Lock l(cs); try { @@ -485,6 +486,10 @@ } } +void ClientManager::on(Save, SimpleXML*) throw() { + save(); +} + User::Ptr& ClientManager::getMe() { if(!me) { Lock l(cs); Modified: dcplusplus/trunk/client/ClientManager.h =================================================================== --- dcplusplus/trunk/client/ClientManager.h 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/client/ClientManager.h 2006-04-30 11:09:50 UTC (rev 599) @@ -106,6 +106,8 @@ CID getMyCID(); const CID& getMyPID(); + + void save(); private: typedef HASH_MAP<string, User::Ptr> LegacyMap; typedef LegacyMap::iterator LegacyIter; Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -1179,6 +1179,8 @@ File::deleteFile(getQueueFile()); File::renameFile(getQueueFile() + ".tmp", getQueueFile()); + ClientManager::getInstance()->save(); + dirty = false; } catch(const FileException&) { // ... Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -42,6 +42,7 @@ "&Browse...", "Browse file list", "Choose folder", +"CID", "Close", "Close connection", "Closing connection...", @@ -644,6 +645,7 @@ "BrowseAccel", "BrowseFileList", "ChooseFolder", +"Cid", "Close", "CloseConnection", "ClosingConnection", Modified: dcplusplus/trunk/client/StringDefs.h =================================================================== --- dcplusplus/trunk/client/StringDefs.h 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/client/StringDefs.h 2006-04-30 11:09:50 UTC (rev 599) @@ -45,6 +45,7 @@ BROWSE_ACCEL, // "&Browse..." BROWSE_FILE_LIST, // "Browse file list" CHOOSE_FOLDER, // "Choose folder" + CID, // "CID" CLOSE, // "Close" CLOSE_CONNECTION, // "Close connection" CLOSING_CONNECTION, // "Closing connection..." Modified: dcplusplus/trunk/windows/FinishedFrame.cpp =================================================================== --- dcplusplus/trunk/windows/FinishedFrame.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/FinishedFrame.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -21,234 +21,8 @@ #include "Resource.h" #include "FinishedFrame.h" -#include "WinUtil.h" -#include "TextFrame.h" -#include "../client/ClientManager.h" -#include "../client/StringTokenizer.h" -int FinishedFrame::columnIndexes[] = { COLUMN_DONE, COLUMN_FILE, COLUMN_PATH, COLUMN_NICK, COLUMN_HUB, COLUMN_SIZE, COLUMN_SPEED, COLUMN_CRC32 }; -int FinishedFrame::columnSizes[] = { 100, 110, 290, 125, 80, 80, 80, 80 }; -static ResourceManager::Strings columnNames[] = { ResourceManager::FILENAME, ResourceManager::TIME, ResourceManager::PATH, -ResourceManager::NICK, ResourceManager::HUB, ResourceManager::SIZE, ResourceManager::SPEED, ResourceManager::CRC_CHECKED -}; - -LRESULT FinishedFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) -{ - CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP); - ctrlStatus.Attach(m_hWndStatusBar); - - ctrlList.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | - WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS, WS_EX_CLIENTEDGE, IDC_FINISHED); - ctrlList.SetExtendedListViewStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT); - - ctrlList.SetImageList(WinUtil::fileImages, LVSIL_SMALL); - ctrlList.SetBkColor(WinUtil::bgColor); - ctrlList.SetTextBkColor(WinUtil::bgColor); - ctrlList.SetTextColor(WinUtil::textColor); - - // Create listview columns - WinUtil::splitTokens(columnIndexes, SETTING(FINISHED_ORDER), COLUMN_LAST); - WinUtil::splitTokens(columnSizes, SETTING(FINISHED_WIDTHS), COLUMN_LAST); - - for(int j=0; j<COLUMN_LAST; j++) { - int fmt = (j == COLUMN_SIZE || j == COLUMN_SPEED) ? LVCFMT_RIGHT : LVCFMT_LEFT; - ctrlList.InsertColumn(j, CTSTRING_I(columnNames[j]), fmt, columnSizes[j], j); - } - - ctrlList.SetColumnOrderArray(COLUMN_LAST, columnIndexes); - ctrlList.setSort(COLUMN_DONE, ExListViewCtrl::SORT_STRING_NOCASE); - - UpdateLayout(); - - FinishedManager::getInstance()->addListener(this); - updateList(FinishedManager::getInstance()->lockList()); - FinishedManager::getInstance()->unlockList(); - - ctxMenu.CreatePopupMenu(); - ctxMenu.AppendMenu(MF_STRING, IDC_VIEW_AS_TEXT, CTSTRING(VIEW_AS_TEXT)); - ctxMenu.AppendMenu(MF_STRING, IDC_OPEN_FILE, CTSTRING(OPEN)); - ctxMenu.AppendMenu(MF_STRING, IDC_OPEN_FOLDER, CTSTRING(OPEN_FOLDER)); - ctxMenu.AppendMenu(MF_SEPARATOR); - ctxMenu.AppendMenu(MF_STRING, IDC_REMOVE, CTSTRING(REMOVE)); - ctxMenu.AppendMenu(MF_STRING, IDC_TOTAL, CTSTRING(REMOVE_ALL)); - ctxMenu.SetMenuDefaultItem(IDC_OPEN_FILE); - - bHandled = FALSE; - return TRUE; -} - -LRESULT FinishedFrame::onContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - if (reinterpret_cast<HWND>(wParam) == ctrlList && ctrlList.GetSelectedCount() > 0) { - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; - - if(pt.x == -1 && pt.y == -1) { - WinUtil::getContextMenuPos(ctrlList, pt); - } - - ctxMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, m_hWnd); - return TRUE; - } - bHandled = FALSE; - return FALSE; -} - -LRESULT FinishedFrame::onColumnClickFinished(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - NMLISTVIEW* const l = (NMLISTVIEW*)pnmh; - if(l->iSubItem == ctrlList.getSortColumn()) { - if (!ctrlList.isAscending()) - ctrlList.setSort(-1, ctrlList.getSortType()); - else - ctrlList.setSortDirection(false); - } else { - switch(l->iSubItem) { - case COLUMN_SIZE: - ctrlList.setSort(l->iSubItem, ExListViewCtrl::SORT_FUNC, true, sortSize); - break; - case COLUMN_SPEED: - ctrlList.setSort(l->iSubItem, ExListViewCtrl::SORT_FUNC, true, sortSpeed); - break; - default: - ctrlList.setSort(l->iSubItem, ExListViewCtrl::SORT_STRING_NOCASE); - break; - } - } - return 0; -} - -void FinishedFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */) { - RECT rect; - GetClientRect(&rect); - - // position bars and offset their dimensions - UpdateBarsPosition(rect, bResizeBars); - - if(ctrlStatus.IsWindow()) { - CRect sr; - int w[4]; - ctrlStatus.GetClientRect(sr); - w[3] = sr.right - 16; - w[2] = max(w[3] - 100, 0); - w[1] = max(w[2] - 100, 0); - w[0] = max(w[1] - 100, 0); - - ctrlStatus.SetParts(4, w); - } - - CRect rc(rect); - ctrlList.MoveWindow(rc); -} - -LRESULT FinishedFrame::onDoubleClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - - NMITEMACTIVATE * const item = (NMITEMACTIVATE*) pnmh; - - if(item->iItem != -1) { - FinishedItem* entry = (FinishedItem*)ctrlList.GetItemData(item->iItem); - WinUtil::openFile(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedFrame::onViewAsText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - int i; - if((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedItem * const entry = (FinishedItem*)ctrlList.GetItemData(i); - TextFrame::openWindow(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedFrame::onOpenFile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - int i; - if((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedItem * const entry = (FinishedItem*)ctrlList.GetItemData(i); - WinUtil::openFile(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedFrame::onOpenFolder(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - int i; - if((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedItem * const entry = (FinishedItem*)ctrlList.GetItemData(i); - WinUtil::openFolder(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedFrame::onRemove(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - switch(wID) - { - case IDC_REMOVE: - { - int i = -1; - while((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedManager::getInstance()->remove((FinishedItem*)ctrlList.GetItemData(i)); - ctrlList.DeleteItem(i); - } - break; - } - case IDC_TOTAL: - FinishedManager::getInstance()->removeAll(); - break; - } - return 0; -} - -LRESULT FinishedFrame::onClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { - if(!closed) { - FinishedManager::getInstance()->removeListener(this); - - closed = true; - PostMessage(WM_CLOSE); - return 0; - } else { - WinUtil::saveHeaderOrder(ctrlList, SettingsManager::FINISHED_ORDER, - SettingsManager::FINISHED_WIDTHS, COLUMN_LAST, columnIndexes, columnSizes); - - bHandled = FALSE; - return 0; - } -} - -LRESULT FinishedFrame::onSpeaker(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { - if(wParam == SPEAK_ADD_LINE) { - FinishedItem* entry = (FinishedItem*)lParam; - addEntry(entry); - if(BOOLSETTING(BOLD_FINISHED_DOWNLOADS)) - setDirty(); - updateStatus(); - } else if(wParam == SPEAK_REMOVE) { - updateStatus(); - } else if(wParam == SPEAK_REMOVE_ALL) { - ctrlList.DeleteAllItems(); - updateStatus(); - } - return 0; -} - -void FinishedFrame::addEntry(FinishedItem* entry) { - TStringList l; - l.push_back(Text::toT(Util::getFileName(entry->getTarget()))); - l.push_back(Text::toT(Util::formatTime("%Y-%m-%d %H:%M:%S", entry->getTime()))); - l.push_back(Text::toT(Util::getFilePath(entry->getTarget()))); - l.push_back(Text::toT(entry->getUser())); - l.push_back(Text::toT(entry->getHub())); - l.push_back(Text::toT(Util::formatBytes(entry->getSize()))); - l.push_back(Text::toT(Util::formatBytes(entry->getAvgSpeed()) + "/s")); - l.push_back(entry->getCrc32Checked() ? TSTRING(YES_STR) : TSTRING(NO_STR)); - totalBytes += entry->getChunkSize(); - totalTime += entry->getMilliSeconds(); - - int image = WinUtil::getIconIndex(Text::toT(entry->getTarget())); - int loc = ctrlList.insert(l, image, (LPARAM)entry); - ctrlList.EnsureVisible(loc, FALSE); -} - /** * @file * $Id: FinishedFrame.cpp,v 1.39 2005/12/19 00:15:52 arnetheduck Exp $ Modified: dcplusplus/trunk/windows/FinishedULFrame.cpp =================================================================== --- dcplusplus/trunk/windows/FinishedULFrame.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/FinishedULFrame.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -21,235 +21,7 @@ #include "Resource.h" #include "FinishedULFrame.h" -#include "WinUtil.h" -#include "TextFrame.h" -#include "../client/ClientManager.h" -#include "../client/StringTokenizer.h" - -int FinishedULFrame::columnIndexes[] = { COLUMN_DONE, COLUMN_FILE, COLUMN_PATH, COLUMN_NICK, COLUMN_HUB, COLUMN_SIZE, COLUMN_SPEED }; -int FinishedULFrame::columnSizes[] = { 100, 110, 290, 125, 80, 80, 80 }; -static ResourceManager::Strings columnNames[] = { ResourceManager::FILENAME, ResourceManager::TIME, ResourceManager::PATH, -ResourceManager::NICK, ResourceManager::HUB, ResourceManager::SIZE, ResourceManager::SPEED -}; - -LRESULT FinishedULFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) -{ - CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP); - ctrlStatus.Attach(m_hWndStatusBar); - - ctrlList.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | - WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS, WS_EX_CLIENTEDGE, IDC_FINISHED_UL); - ctrlList.SetExtendedListViewStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT); - - ctrlList.SetImageList(WinUtil::fileImages, LVSIL_SMALL); - ctrlList.SetBkColor(WinUtil::bgColor); - ctrlList.SetTextBkColor(WinUtil::bgColor); - ctrlList.SetTextColor(WinUtil::textColor); - - // Create listview columns - WinUtil::splitTokens(columnIndexes, SETTING(FINISHED_UL_ORDER), COLUMN_LAST); - WinUtil::splitTokens(columnSizes, SETTING(FINISHED_UL_WIDTHS), COLUMN_LAST); - - for(int j=0; j<COLUMN_LAST; j++) { - int fmt = (j == COLUMN_SIZE || j == COLUMN_SPEED) ? LVCFMT_RIGHT : LVCFMT_LEFT; - ctrlList.InsertColumn(j, CTSTRING_I(columnNames[j]), fmt, columnSizes[j], j); - } - - ctrlList.SetColumnOrderArray(COLUMN_LAST, columnIndexes); - ctrlList.setSort(COLUMN_DONE, ExListViewCtrl::SORT_STRING_NOCASE); - - UpdateLayout(); - - FinishedManager::getInstance()->addListener(this); - updateList(FinishedManager::getInstance()->lockList(true)); - FinishedManager::getInstance()->unlockList(); - - ctxMenu.CreatePopupMenu(); - ctxMenu.AppendMenu(MF_STRING, IDC_VIEW_AS_TEXT, CTSTRING(VIEW_AS_TEXT)); - ctxMenu.AppendMenu(MF_STRING, IDC_OPEN_FILE, CTSTRING(OPEN)); - ctxMenu.AppendMenu(MF_STRING, IDC_OPEN_FOLDER, CTSTRING(OPEN_FOLDER)); - ctxMenu.AppendMenu(MF_SEPARATOR); - ctxMenu.AppendMenu(MF_STRING, IDC_REMOVE, CTSTRING(REMOVE)); - ctxMenu.AppendMenu(MF_STRING, IDC_TOTAL, CTSTRING(REMOVE_ALL)); - ctxMenu.SetMenuDefaultItem(IDC_OPEN_FILE); - - bHandled = FALSE; - return TRUE; -} - -LRESULT FinishedULFrame::onContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - if (reinterpret_cast<HWND>(wParam) == ctrlList && ctrlList.GetSelectedCount() > 0) { - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; - - if(pt.x == -1 && pt.y == -1) { - WinUtil::getContextMenuPos(ctrlList, pt); - } - - ctxMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, m_hWnd); - return TRUE; - } - - bHandled = FALSE; - return FALSE; -} - -LRESULT FinishedULFrame::onColumnClickFinished(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - NMLISTVIEW* const l = (NMLISTVIEW*)pnmh; - if(l->iSubItem == ctrlList.getSortColumn()) { - if (!ctrlList.isAscending()) - ctrlList.setSort(-1, ctrlList.getSortType()); - else - ctrlList.setSortDirection(false); - } else { - switch(l->iSubItem) { - case COLUMN_SIZE: - ctrlList.setSort(l->iSubItem, ExListViewCtrl::SORT_FUNC, true, sortSize); - break; - case COLUMN_SPEED: - ctrlList.setSort(l->iSubItem, ExListViewCtrl::SORT_FUNC, true, sortSpeed); - break; - default: - ctrlList.setSort(l->iSubItem, ExListViewCtrl::SORT_STRING_NOCASE); - break; - } - } - return 0; -} - -void FinishedULFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */) -{ - RECT rect; - GetClientRect(&rect); - - // position bars and offset their dimensions - UpdateBarsPosition(rect, bResizeBars); - - if(ctrlStatus.IsWindow()) { - CRect sr; - int w[4]; - ctrlStatus.GetClientRect(sr); - w[3] = sr.right - 16; - w[2] = max(w[3] - 100, 0); - w[1] = max(w[2] - 100, 0); - w[0] = max(w[1] - 100, 0); - - ctrlStatus.SetParts(4, w); - } - - CRect rc(rect); - ctrlList.MoveWindow(rc); -} - -LRESULT FinishedULFrame::onDoubleClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - - NMITEMACTIVATE * const item = (NMITEMACTIVATE*) pnmh; - - if(item->iItem != -1) { - FinishedItem* entry = (FinishedItem*)ctrlList.GetItemData(item->iItem); - WinUtil::openFile(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedULFrame::onViewAsText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - int i; - if((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedItem * const entry = (FinishedItem*)ctrlList.GetItemData(i); - TextFrame::openWindow(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedULFrame::onOpenFile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - int i; - if((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedItem * const entry = (FinishedItem*)ctrlList.GetItemData(i); - WinUtil::openFile(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedULFrame::onOpenFolder(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) -{ - int i; - if((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedItem * const entry = (FinishedItem*)ctrlList.GetItemData(i); - WinUtil::openFolder(Text::toT(entry->getTarget())); - } - return 0; -} - -LRESULT FinishedULFrame::onRemove(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - switch(wID) - { - case IDC_REMOVE: - { - int i = -1; - while((i = ctrlList.GetNextItem(-1, LVNI_SELECTED)) != -1) { - FinishedManager::getInstance()->remove((FinishedItem*)ctrlList.GetItemData(i), true); - ctrlList.DeleteItem(i); - } - break; - } - case IDC_TOTAL: - FinishedManager::getInstance()->removeAll(true); - break; - } - return 0; -} - -LRESULT FinishedULFrame::onClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { - if(!closed) { - FinishedManager::getInstance()->removeListener(this); - - closed = true; - PostMessage(WM_CLOSE); - return 0; - } else { - WinUtil::saveHeaderOrder(ctrlList, SettingsManager::FINISHED_UL_ORDER, - SettingsManager::FINISHED_UL_WIDTHS, COLUMN_LAST, columnIndexes, columnSizes); - - bHandled = FALSE; - return 0; - } -} - -LRESULT FinishedULFrame::onSpeaker(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { - if(wParam == SPEAK_ADD_LINE) { - FinishedItem* entry = (FinishedItem*)lParam; - addEntry(entry); - if(BOOLSETTING(BOLD_FINISHED_UPLOADS)) - setDirty(); - updateStatus(); - } else if(wParam == SPEAK_REMOVE) { - updateStatus(); - } else if(wParam == SPEAK_REMOVE_ALL) { - ctrlList.DeleteAllItems(); - updateStatus(); - } - return 0; -} - -void FinishedULFrame::addEntry(FinishedItem* entry) { - TStringList l; - l.push_back(Text::toT(Util::getFileName(entry->getTarget()))); - l.push_back(Text::toT(Util::formatTime("%Y-%m-%d %H:%M:%S", entry->getTime()))); - l.push_back(Text::toT(Util::getFilePath(entry->getTarget()))); - l.push_back(Text::toT(entry->getUser())); - l.push_back(Text::toT(entry->getHub())); - l.push_back(Text::toT(Util::formatBytes(entry->getSize()))); - l.push_back(Text::toT(Util::formatBytes(entry->getAvgSpeed()) + "/s")); - totalBytes += entry->getChunkSize(); - totalTime += entry->getMilliSeconds(); - - int image = WinUtil::getIconIndex(Text::toT(entry->getTarget())); - int loc = ctrlList.insert(l, image, (LPARAM)entry); - ctrlList.EnsureVisible(loc, FALSE); -} - /** * @file * $Id: FinishedULFrame.cpp,v 1.32 2005/12/19 00:15:52 arnetheduck Exp $ Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -37,10 +37,10 @@ HubFrame::FrameMap HubFrame::frames; -int HubFrame::columnSizes[] = { 100, 75, 75, 100, 75, 100 }; -int HubFrame::columnIndexes[] = { COLUMN_NICK, COLUMN_SHARED, COLUMN_DESCRIPTION, COLUMN_TAG, COLUMN_CONNECTION, COLUMN_EMAIL }; +int HubFrame::columnSizes[] = { 100, 75, 75, 100, 75, 100, 125 }; +int HubFrame::columnIndexes[] = { COLUMN_NICK, COLUMN_SHARED, COLUMN_DESCRIPTION, COLUMN_TAG, COLUMN_CONNECTION, COLUMN_EMAIL, COLUMN_CID }; static ResourceManager::Strings columnNames[] = { ResourceManager::NICK, ResourceManager::SHARED, -ResourceManager::DESCRIPTION, ResourceManager::TAG, ResourceManager::CONNECTION, ResourceManager::EMAIL }; +ResourceManager::DESCRIPTION, ResourceManager::TAG, ResourceManager::CONNECTION, ResourceManager::EMAIL, ResourceManager::CID }; LRESULT HubFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { @@ -421,6 +421,7 @@ columns[COLUMN_TAG] = Text::toT(identity.getTag()); columns[COLUMN_CONNECTION] = Text::toT(identity.getConnection()); columns[COLUMN_EMAIL] = Text::toT(identity.getEmail()); + columns[COLUMN_CID] = Text::toT(identity.getUser()->getCID().toBase32()); if(sortCol != -1) { needsSort = needsSort || (old != columns[sortCol]); Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/HubFrame.h 2006-04-30 11:09:50 UTC (rev 599) @@ -166,6 +166,7 @@ COLUMN_TAG, COLUMN_CONNECTION, COLUMN_EMAIL, + COLUMN_CID, COLUMN_LAST }; Modified: dcplusplus/trunk/windows/SearchFrm.cpp =================================================================== --- dcplusplus/trunk/windows/SearchFrm.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/SearchFrm.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -30,12 +30,12 @@ TStringList SearchFrame::lastSearches; int SearchFrame::columnIndexes[] = { COLUMN_FILENAME, COLUMN_NICK, COLUMN_TYPE, COLUMN_SIZE, - COLUMN_PATH, COLUMN_SLOTS, COLUMN_CONNECTION, COLUMN_HUB, COLUMN_EXACT_SIZE, COLUMN_IP, COLUMN_TTH }; -int SearchFrame::columnSizes[] = { 200, 100, 50, 80, 100, 40, 70, 150, 80, 100, 125 }; + COLUMN_PATH, COLUMN_SLOTS, COLUMN_CONNECTION, COLUMN_HUB, COLUMN_EXACT_SIZE, COLUMN_IP, COLUMN_TTH, COLUMN_CID }; +int SearchFrame::columnSizes[] = { 200, 100, 50, 80, 100, 40, 70, 150, 80, 100, 125, 125 }; static ResourceManager::Strings columnNames[] = { ResourceManager::FILE, ResourceManager::USER, ResourceManager::TYPE, ResourceManager::SIZE, ResourceManager::PATH, ResourceManager::SLOTS, ResourceManager::CONNECTION, - ResourceManager::HUB, ResourceManager::EXACT_SIZE, ResourceManager::IP_BARE, ResourceManager::TTH_ROOT }; + ResourceManager::HUB, ResourceManager::EXACT_SIZE, ResourceManager::IP_BARE, ResourceManager::TTH_ROOT, ResourceManager::CID }; void SearchFrame::openWindow(const tstring& str /* = Util::emptyString */, LONGLONG size /* = 0 */, SearchManager::SizeModes mode /* = SearchManager::SIZE_ATLEAST */, SearchManager::TypeModes type /* = SearchManager::TYPE_ANY ( 0 ) */) { SearchFrame* pChild = new SearchFrame(); @@ -407,7 +407,7 @@ void SearchFrame::SearchInfo::view() { try { if(sr->getType() == SearchResult::TYPE_FILE) { - QueueManager::getInstance()->add(Util::getTempPath() + Text::fromT(fileName), + QueueManager::getInstance()->add(Util::getTempPath() + Text::fromT(columns[COLUMN_FILENAME]), sr->getSize(), sr->getTTH(), sr->getUser(), sr->getFile(), sr->getUtf8(), QueueItem::FLAG_CLIENT_VIEW | QueueItem::FLAG_TEXT); } @@ -418,7 +418,7 @@ void SearchFrame::SearchInfo::Download::operator()(SearchInfo* si) { try { if(si->sr->getType() == SearchResult::TYPE_FILE) { - string target = Text::fromT(tgt + si->fileName); + string target = Text::fromT(tgt + si->columns[COLUMN_FILENAME]); QueueManager::getInstance()->add(target, si->sr->getSize(), si->sr->getTTH(), si->sr->getUser(), si->sr->getFile(), si->sr->getUtf8()); @@ -436,7 +436,7 @@ void SearchFrame::SearchInfo::DownloadWhole::operator()(SearchInfo* si) { try { if(si->sr->getType() == SearchResult::TYPE_FILE) { - QueueManager::getInstance()->addDirectory(Text::fromT(si->path), si->sr->getUser(), Text::fromT(tgt), + QueueManager::getInstance()->addDirectory(Text::fromT(si->columns[COLUMN_PATH]), si->sr->getUser(), Text::fromT(tgt), WinUtil::isShift() ? QueueItem::HIGHEST : QueueItem::DEFAULT); } else { QueueManager::getInstance()->addDirectory(si->sr->getFile(), si->sr->getUser(), Text::fromT(tgt), @@ -466,7 +466,7 @@ void SearchFrame::SearchInfo::getList() { try { - WinUtil::addInitalDir(sr->getUser(), Text::fromT(getPath())); + WinUtil::addInitalDir(sr->getUser(), Text::fromT(columns[COLUMN_PATH])); QueueManager::getInstance()->addList(sr->getUser(), QueueItem::FLAG_CLIENT_VIEW); } catch(const Exception&) { // Ignore for now... @@ -475,20 +475,20 @@ void SearchFrame::SearchInfo::browseList() { try { - QueueManager::getInstance()->addPfs(sr->getUser(), Text::fromT(getPath())); + QueueManager::getInstance()->addPfs(sr->getUser(), Text::fromT(columns[COLUMN_PATH])); } catch(const Exception&) { // Ignore for now... } } void SearchFrame::SearchInfo::CheckSize::operator()(SearchInfo* si) { - if(!si->getTTH().empty()) { + if(!si->columns[COLUMN_TTH].empty()) { if(firstTTH) { - tth = si->getTTH(); + tth = si->columns[COLUMN_TTH]; hasTTH = true; firstTTH = false; } else if(hasTTH) { - if(tth != si->getTTH()) { + if(tth != si->columns[COLUMN_TTH]) { hasTTH = false; } } @@ -499,10 +499,10 @@ if(si->sr->getType() == SearchResult::TYPE_FILE) { if(ext.empty()) { - ext = Util::getFileExt(si->fileName); + ext = Util::getFileExt(si->columns[COLUMN_FILENAME]); size = si->sr->getSize(); } else if(size != -1) { - if((si->sr->getSize() != size) || (Util::stricmp(ext, Util::getFileExt(si->fileName)) != 0)) { + if((si->sr->getSize() != size) || (Util::stricmp(ext, Util::getFileExt(si->columns[COLUMN_FILENAME])) != 0)) { size = -1; } } @@ -526,7 +526,7 @@ SearchResult* sr = si->sr; if(sr->getType() == SearchResult::TYPE_FILE) { - tstring target = Text::toT(SETTING(DOWNLOAD_DIRECTORY)) + si->getFileName(); + tstring target = Text::toT(SETTING(DOWNLOAD_DIRECTORY)) + si->columns[COLUMN_FILENAME]; if(WinUtil::browseFile(target, m_hWnd)) { WinUtil::addLastDir(Util::getFilePath(target)); ctrlResults.forEachSelectedT(SearchInfo::DownloadTarget(target)); @@ -1140,39 +1140,42 @@ void SearchFrame::SearchInfo::update() { if(sr->getType() == SearchResult::TYPE_FILE) { if(sr->getFile().rfind(_T('\\')) == tstring::npos) { - fileName = Text::toT(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile())); + columns[COLUMN_FILENAME] = Text::toT(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile())); } else { - fileName = Text::toT(Util::getFileName(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile()))); - path = Text::toT(Util::getFilePath(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile()))); + columns[COLUMN_FILENAME] = Text::toT(Util::getFileName(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile()))); + columns[COLUMN_PATH] = Text::toT(Util::getFilePath(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile()))); } - type = Text::toT(Util::getFileExt(Text::fromT(fileName))); - if(!type.empty() && type[0] == _T('.')) - type.erase(0, 1); - size = Text::toT(Util::formatBytes(sr->getSize())); - exactSize = Text::toT(Util::formatExactSize(sr->getSize())); + columns[COLUMN_TYPE] = Text::toT(Util::getFileExt(Text::fromT(columns[COLUMN_FILENAME]))); + if(!columns[COLUMN_TYPE].empty() && columns[COLUMN_TYPE][0] == _T('.')) + columns[COLUMN_TYPE].erase(0, 1); + columns[COLUMN_SIZE] = Text::toT(Util::formatBytes(sr->getSize())); + columns[COLUMN_EXACT_SIZE] = Text::toT(Util::formatExactSize(sr->getSize())); } else { - fileName = Text::toT(sr->getUtf8() ? sr->getFileName() : Text::acpToUtf8(sr->getFileName())); - path = Text::toT(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile())); - type = TSTRING(DIRECTORY); + columns[COLUMN_FILENAME] = Text::toT(sr->getUtf8() ? sr->getFileName() : Text::acpToUtf8(sr->getFileName())); + columns[COLUMN_PATH] = Text::toT(sr->getUtf8() ? sr->getFile() : Text::acpToUtf8(sr->getFile())); + columns[COLUMN_TYPE] = TSTRING(DIRECTORY); if(sr->getSize() > 0) { - size = Text::toT(Util::formatBytes(sr->getSize())); - exactSize = Text::toT(Util::formatExactSize(sr->getSize())); + columns[COLUMN_SIZE] = Text::toT(Util::formatBytes(sr->getSize())); + columns[COLUMN_EXACT_SIZE] = Text::toT(Util::formatExactSize(sr->getSize())); } } - nick = WinUtil::getNicks(sr->getUser()); - connection = Text::toT(ClientManager::getInstance()->getConnection(sr->getUser()->getCID())); - hubName = Text::toT(sr->getHubName()); - slots = Text::toT(sr->getSlotString()); - ip = Text::toT(sr->getIP()); - if (!ip.empty()) { + columns[COLUMN_NICK] = WinUtil::getNicks(sr->getUser()); + columns[COLUMN_CONNECTION] = Text::toT(ClientManager::getInstance()->getConnection(sr->getUser()->getCID())); + columns[COLUMN_HUB] = Text::toT(sr->getHubName()); + columns[COLUMN_SLOTS] = Text::toT(sr->getSlotString()); + columns[COLUMN_IP] = Text::toT(sr->getIP()); + if (!columns[COLUMN_IP].empty()) { // Only attempt to grab a country mapping if we actually have an IP address tstring tmpCountry = Text::toT(Util::getIpCountry(sr->getIP())); if(!tmpCountry.empty()) - ip = tmpCountry + _T(" (") + ip + _T(")"); + columns[COLUMN_IP] = tmpCountry + _T(" (") + columns[COLUMN_IP] + _T(")"); } - if(sr->getTTH() != NULL) - setTTH(Text::toT(sr->getTTH()->toBase32())); + if(sr->getTTH() != NULL) { + columns[COLUMN_TTH] = Text::toT(sr->getTTH()->toBase32()); + } + columns[COLUMN_CID] = Text::toT(sr->getUser()->getCID().toBase32()); + } /** Modified: dcplusplus/trunk/windows/SearchFrm.h =================================================================== --- dcplusplus/trunk/windows/SearchFrm.h 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/SearchFrm.h 2006-04-30 11:09:50 UTC (rev 599) @@ -232,13 +232,12 @@ COLUMN_EXACT_SIZE, COLUMN_IP, COLUMN_TTH, + COLUMN_CID, COLUMN_LAST }; class SearchInfo : public UserInfoBase { public: - SearchResult* sr; - SearchInfo(SearchResult* aSR) : UserInfoBase(aSR->getUser()), sr(aSR) { sr->incRef(); update(); } @@ -278,29 +277,14 @@ tstring tth; }; - const tstring& getText(int col) const { - switch(col) { - case COLUMN_NICK: return nick; - case COLUMN_FILENAME: return fileName; - case COLUMN_TYPE: return type; - case COLUMN_SIZE: return size; - case COLUMN_PATH: return path; - case COLUMN_SLOTS: return slots; - case COLUMN_CONNECTION: return connection; - case COLUMN_HUB: return hubName; - case COLUMN_EXACT_SIZE: return exactSize; - case COLUMN_IP: return ip; - case COLUMN_TTH: return tth; - default: return Util::emptyStringT; - } - } + const tstring& getText(int col) const { return columns[col]; } static int compareItems(SearchInfo* a, SearchInfo* b, int col) { switch(col) { case COLUMN_TYPE: if(a->sr->getType() == b->sr->getType()) - return lstrcmpi(a->type.c_str(), b->type.c_str()); + return lstrcmpi(a->columns[COLUMN_TYPE].c_str(), b->columns[COLUMN_TYPE].c_str()); else return(a->sr->getType() == SearchResult::TYPE_DIRECTORY) ? -1 : 1; case COLUMN_SLOTS: @@ -316,17 +300,8 @@ void update(); - GETSET(tstring, nick, Nick); - GETSET(tstring, connection, Connection) - GETSET(tstring, fileName, FileName); - GETSET(tstring, path, Path); - GETSET(tstring, type, Type); - GETSET(tstring, hubName, HubName); - GETSET(tstring, size, Size); - GETSET(tstring, slots, Slots); - GETSET(tstring, exactSize, ExactSize); - GETSET(tstring, ip, IP); - GETSET(tstring, tth, TTH); + SearchResult* sr; + tstring columns[COLUMN_LAST]; }; struct HubInfo : public FastAlloc<HubInfo> { Modified: dcplusplus/trunk/windows/TransferView.cpp =================================================================== --- dcplusplus/trunk/windows/TransferView.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/TransferView.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -28,12 +28,12 @@ #include "WinUtil.h" #include "TransferView.h" -int TransferView::columnIndexes[] = { COLUMN_USER, COLUMN_HUB, COLUMN_STATUS, COLUMN_TIMELEFT, COLUMN_SPEED, COLUMN_FILE, COLUMN_SIZE, COLUMN_PATH, COLUMN_IP, COLUMN_RATIO }; -int TransferView::columnSizes[] = { 150, 100, 250, 75, 75, 175, 100, 200, 50, 75 }; +int TransferView::columnIndexes[] = { COLUMN_USER, COLUMN_HUB, COLUMN_STATUS, COLUMN_TIMELEFT, COLUMN_SPEED, COLUMN_FILE, COLUMN_SIZE, COLUMN_PATH, COLUMN_IP, COLUMN_RATIO, COLUMN_CID }; +int TransferView::columnSizes[] = { 150, 100, 250, 75, 75, 175, 100, 200, 50, 75, 125 }; static ResourceManager::Strings columnNames[] = { ResourceManager::USER, ResourceManager::HUB, ResourceManager::STATUS, ResourceManager::TIME_LEFT, ResourceManager::SPEED, ResourceManager::FILENAME, ResourceManager::SIZE, ResourceManager::PATH, -ResourceManager::IP_BARE, ResourceManager::RATIO}; +ResourceManager::IP_BARE, ResourceManager::RATIO, ResourceManager::CID, }; TransferView::~TransferView() { arrows.Destroy(); @@ -344,6 +344,7 @@ { columns[COLUMN_USER] = WinUtil::getNicks(u); columns[COLUMN_HUB] = WinUtil::getHubNames(u).first; + columns[COLUMN_CID] = Text::toT(u->getCID().toBase32()); } void TransferView::ItemInfo::update(const UpdateInfo& ui) { Modified: dcplusplus/trunk/windows/TransferView.h =================================================================== --- dcplusplus/trunk/windows/TransferView.h 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/TransferView.h 2006-04-30 11:09:50 UTC (rev 599) @@ -133,6 +133,7 @@ COLUMN_PATH, COLUMN_IP, COLUMN_RATIO, + COLUMN_CID, COLUMN_LAST }; @@ -215,7 +216,7 @@ MASK_TIMELEFT = 1 << 7, MASK_IP = 1 << 8, MASK_STATUS_STRING = 1 << 9, - MASK_COUNTRY = 1 << 10 + MASK_COUNTRY = 1 << 10, }; bool operator==(const ItemInfo& ii) { return download == ii.download && user == ii.user; } Modified: dcplusplus/trunk/windows/UsersFrame.cpp =================================================================== --- dcplusplus/trunk/windows/UsersFrame.cpp 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/UsersFrame.cpp 2006-04-30 11:09:50 UTC (rev 599) @@ -29,9 +29,9 @@ #include "HubFrame.h" -int UsersFrame::columnIndexes[] = { COLUMN_NICK, COLUMN_HUB, COLUMN_SEEN, COLUMN_DESCRIPTION }; -int UsersFrame::columnSizes[] = { 200, 300, 150, 200 }; -static ResourceManager::Strings columnNames[] = { ResourceManager::AUTO_GRANT, ResourceManager::LAST_HUB, ResourceManager::LAST_SEEN, ResourceManager::DESCRIPTION }; +int UsersFrame::columnIndexes[] = { COLUMN_NICK, COLUMN_HUB, COLUMN_SEEN, COLUMN_DESCRIPTION, COLUMN_CID }; +int UsersFrame::columnSizes[] = { 200, 300, 150, 200, 125 }; +static ResourceManager::Strings columnNames[] = { ResourceManager::AUTO_GRANT, ResourceManager::LAST_HUB, ResourceManager::LAST_SEEN, ResourceManager::DESCRIPTION, ResourceManager::CID }; LRESULT UsersFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { @@ -216,6 +216,7 @@ columns[COLUMN_HUB] = user->isOnline() ? WinUtil::getHubNames(u.getUser()).first : Text::toT(u.getUrl()); columns[COLUMN_SEEN] = user->isOnline() ? TSTRING(ONLINE) : Text::toT(Util::formatTime("%Y-%m-%d %H:%M", u.getLastSeen())); columns[COLUMN_DESCRIPTION] = Text::toT(u.getDescription()); + columns[COLUMN_CID] = Text::toT(u.getUser()->getCID().toBase32()); } LRESULT UsersFrame::onSpeaker(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { Modified: dcplusplus/trunk/windows/UsersFrame.h =================================================================== --- dcplusplus/trunk/windows/UsersFrame.h 2006-04-30 09:27:55 UTC (rev 598) +++ dcplusplus/trunk/windows/UsersFrame.h 2006-04-30 11:09:50 UTC (rev 599) @@ -85,6 +85,7 @@ COLUMN_HUB, COLUMN_SEEN, COLUMN_DESCRIPTION, + COLUMN_CID, COLUMN_LAST }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-04-30 12:14:25
|
Revision: 600 Author: arnetheduck Date: 2006-04-30 05:13:44 -0700 (Sun, 30 Apr 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=600&view=rev Log Message: ----------- Updated yaSSL Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/yassl/README dcplusplus/trunk/yassl/include/crypto_wrapper.hpp dcplusplus/trunk/yassl/include/openssl/ssl.h dcplusplus/trunk/yassl/include/yassl_imp.hpp dcplusplus/trunk/yassl/include/yassl_types.hpp dcplusplus/trunk/yassl/src/crypto_wrapper.cpp dcplusplus/trunk/yassl/src/handshake.cpp dcplusplus/trunk/yassl/src/ssl.cpp dcplusplus/trunk/yassl/src/yassl_imp.cpp dcplusplus/trunk/yassl/src/yassl_int.cpp dcplusplus/trunk/yassl/taocrypt/include/asn.hpp dcplusplus/trunk/yassl/taocrypt/include/dh.hpp dcplusplus/trunk/yassl/taocrypt/src/aes.cpp dcplusplus/trunk/yassl/taocrypt/src/arc4.cpp dcplusplus/trunk/yassl/taocrypt/src/coding.cpp dcplusplus/trunk/yassl/taocrypt/src/dh.cpp dcplusplus/trunk/yassl/taocrypt/src/random.cpp dcplusplus/trunk/yassl/yassl.vcproj Added Paths: ----------- dcplusplus/trunk/yassl/src/yassl.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/changelog.txt 2006-04-30 12:13:44 UTC (rev 600) @@ -6,6 +6,7 @@ * Saved users file more often to have fewer missing nicks around * CID of user shown if nick is missing (in queue for example) * Added display of CID in a few places +* Updated yaSSL to 1.2.2 -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off Modified: dcplusplus/trunk/yassl/README =================================================================== --- dcplusplus/trunk/yassl/README 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/README 2006-04-30 12:13:44 UTC (rev 600) @@ -1,6 +1,26 @@ -yaSSL Release notes, version 1.1.5 +yaSSL Release notes, version 1.2.2 (03/27/06) + + This release of yaSSL contains minor bug fixes and portability enhancements. + +See build instructions below under 1.0.6: + + + +*****************yaSSL Release notes, version 1.2.0 + + This release of yaSSL contains minor bug fixes, portability enhancements, + Diffie-Hellman compatibility fixes for other servers and client, + optimization improvements, and x86 ASM changes. + +See build instructions below under 1.0.6: + + + +*****************yaSSL Release notes, version 1.1.5 + + This release of yaSSL contains minor bug fixes, portability enhancements, and user requested changes including the ability to add all certificates in a directory, more robust socket handling, no new overloading unless requested, and an SSL_VERIFY_NONE option. Modified: dcplusplus/trunk/yassl/include/crypto_wrapper.hpp =================================================================== --- dcplusplus/trunk/yassl/include/crypto_wrapper.hpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/include/crypto_wrapper.hpp 2006-04-30 12:13:44 UTC (rev 600) @@ -41,8 +41,8 @@ namespace yaSSL { -// Digest policy should implement a get_digest, update, and get sizes for pad and -// digest +// Digest policy should implement a get_digest, update, and get sizes for pad +// and digest struct Digest : public virtual_base { virtual void get_digest(byte*) = 0; virtual void get_digest(byte*, const byte*, unsigned int) = 0; @@ -380,7 +380,7 @@ uint get_agreedKeyLength() const; const byte* get_agreedKey() const; const byte* get_publicKey() const; - void makeAgreement(const byte*); + void makeAgreement(const byte*, unsigned int); void set_sizes(int&, int&, int&) const; void get_parms(byte*, byte*, byte*) const; Modified: dcplusplus/trunk/yassl/include/openssl/ssl.h =================================================================== --- dcplusplus/trunk/yassl/include/openssl/ssl.h 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/include/openssl/ssl.h 2006-04-30 12:13:44 UTC (rev 600) @@ -50,11 +50,11 @@ class X509; class X509_NAME; #else - typedef struct SSL SSL; - typedef struct SSL_SESION SSL_SESSION; - typedef struct SSL_METHOD SSL_METHOD; - typedef struct SSL_CTX SSL_CTX; - typedef struct SSL_CIPHER SSL_CIPHER; + typedef struct SSL SSL; + typedef struct SSL_SESSION SSL_SESSION; + typedef struct SSL_METHOD SSL_METHOD; + typedef struct SSL_CTX SSL_CTX; + typedef struct SSL_CIPHER SSL_CIPHER; typedef struct RSA RSA; Modified: dcplusplus/trunk/yassl/include/yassl_imp.hpp =================================================================== --- dcplusplus/trunk/yassl/include/yassl_imp.hpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/include/yassl_imp.hpp 2006-04-30 12:13:44 UTC (rev 600) @@ -662,7 +662,7 @@ uint8 suites_size_; Cipher suites_[MAX_SUITE_SZ]; char cipher_name_[MAX_SUITE_NAME]; - char cipher_list_[MAX_CIPHER_LIST]; + char cipher_list_[MAX_CIPHERS][MAX_SUITE_NAME]; Parameters(ConnectionEnd, const Ciphers&, ProtocolVersion); Modified: dcplusplus/trunk/yassl/include/yassl_types.hpp =================================================================== --- dcplusplus/trunk/yassl/include/yassl_types.hpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/include/yassl_types.hpp 2006-04-30 12:13:44 UTC (rev 600) @@ -132,7 +132,7 @@ const int FORTEZZA_MAX = 128; // Maximum Fortezza Key length const int MAX_SUITE_SZ = 64; // 32 max suites * sizeof(suite) const int MAX_SUITE_NAME = 48; // max length of suite name -const int MAX_CIPHER_LIST = 512; // max length of cipher list names +const int MAX_CIPHERS = 32; // max supported ciphers for cipher list const int SIZEOF_ENUM = 1; // SSL considers an enum 1 byte, not 4 const int SIZEOF_SENDER = 4; // Sender constant, for finished generation const int PAD_MD5 = 48; // pad length 1 and 2 for md5 finished Modified: dcplusplus/trunk/yassl/src/crypto_wrapper.cpp =================================================================== --- dcplusplus/trunk/yassl/src/crypto_wrapper.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/src/crypto_wrapper.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -855,9 +855,9 @@ } -void DiffieHellman::makeAgreement(const byte* other) +void DiffieHellman::makeAgreement(const byte* other, unsigned int otherSz) { - pimpl_->dh_.Agree(pimpl_->agreedKey_, pimpl_->privateKey_, other); + pimpl_->dh_.Agree(pimpl_->agreedKey_, pimpl_->privateKey_, other, otherSz); } Modified: dcplusplus/trunk/yassl/src/handshake.cpp =================================================================== --- dcplusplus/trunk/yassl/src/handshake.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/src/handshake.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -605,7 +605,7 @@ void PRF(byte* digest, uint digLen, const byte* secret, uint secLen, const byte* label, uint labLen, const byte* seed, uint seedLen) { - uint half = secLen / 2 + secLen % 2; + uint half = (secLen + 1) / 2; output_buffer md5_half(half); output_buffer sha_half(half); Modified: dcplusplus/trunk/yassl/src/ssl.cpp =================================================================== --- dcplusplus/trunk/yassl/src/ssl.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/src/ssl.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -291,9 +291,15 @@ } -const char* SSL_get_cipher_list(SSL* ssl, int /*priority */) +const char* SSL_get_cipher_list(SSL* ssl, int priority) { - return ssl->getSecurity().get_parms().cipher_list_; + if (priority < 0 || priority >= MAX_CIPHERS) + return 0; + + if (ssl->getSecurity().get_parms().cipher_list_[priority][0]) + return ssl->getSecurity().get_parms().cipher_list_[priority]; + + return 0; } Added: dcplusplus/trunk/yassl/src/yassl.cpp =================================================================== --- dcplusplus/trunk/yassl/src/yassl.cpp (rev 0) +++ dcplusplus/trunk/yassl/src/yassl.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -0,0 +1,244 @@ +/* yassl.cpp + * + * Copyright (C) 2003 Sawtooth Consulting Ltd. + * + * This file is part of yaSSL. + * + * yaSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * yaSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/* yaSSL implements external API + */ + +#include "runtime.hpp" +#include "yassl.hpp" +#include "yassl_int.hpp" +#include "handshake.hpp" +#include <stdio.h> + +#include "openssl/ssl.h" // get rid of this + + +// yaSSL overloads hide these +void* operator new[](size_t sz) +{ + return ::operator new(sz); +} + +void operator delete[](void* ptr) +{ + ::operator delete(ptr); +} + + +namespace yaSSL { + +using mySTL::min; + + +struct Base { + SSL_METHOD* method_; + SSL_CTX* ctx_; + SSL* ssl_; + + char* ca_; + char* cert_; + char* key_; + + DH* dh_; + + Base() : method_(0), ctx_(0), ssl_(0), ca_(0), cert_(0), key_(0), dh_(0) + {} + + ~Base() + { + if (dh_) DH_free(dh_); + delete[] key_; + delete[] cert_; + delete[] ca_; + SSL_CTX_free(ctx_); // frees method_ too + SSL_free(ssl_); + } +}; + + +void SetDH(Base&); + +void SetUpBase(Base& base, ConnectionEnd end, SOCKET_T s) +{ + base.method_ = new SSL_METHOD(end, ProtocolVersion(3,1)); + base.ctx_ = new SSL_CTX(base.method_); + + if (base.ca_) + if (SSL_CTX_load_verify_locations(base.ctx_, + base.ca_, 0) != SSL_SUCCESS) assert(0); + if (base.cert_) + if (SSL_CTX_use_certificate_file(base.ctx_, + base.cert_, SSL_FILETYPE_PEM) != SSL_SUCCESS) assert(0); + if (base.key_) + if (SSL_CTX_use_PrivateKey_file(base.ctx_, base.key_, + SSL_FILETYPE_PEM) != SSL_SUCCESS) assert(0); + + if (end == server_end) SetDH(base); + + base.ssl_ = new SSL(base.ctx_); + base.ssl_->useSocket().set_fd(s); +} + + +void SetDH(Base& base) +{ + static unsigned char dh512_p[] = + { + 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75, + 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F, + 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3, + 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12, + 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C, + 0x47,0x74,0xE8,0x33, + }; + + static unsigned char dh512_g[] = + { + 0x02, + }; + + if ( (base.dh_ = DH_new()) ) { + base.dh_->p = BN_bin2bn(dh512_p, sizeof(dh512_p), 0); + base.dh_->g = BN_bin2bn(dh512_g, sizeof(dh512_g), 0); + } + if (!base.dh_->p || !base.dh_->g) { + DH_free(base.dh_); + base.dh_ = 0; + } + SSL_CTX_set_tmp_dh(base.ctx_, base.dh_); +} + + +void NewCopy(char*& dst, const char* src) +{ + size_t len = strlen(src) + 1; + dst = new char[len]; + + strncpy(dst, src, len); +} + + +// Client Implementation +struct Client::ClientImpl { + Base base_; +}; + + +Client::Client() : pimpl_(new ClientImpl) +{} + + +Client::~Client() { delete pimpl_; } + + +int Client::Connect(SOCKET_T s) +{ + SetUpBase(pimpl_->base_, client_end, s); + return SSL_connect(pimpl_->base_.ssl_); +} + + +int Client::Write(const void* buffer, int sz) +{ + return sendData(*pimpl_->base_.ssl_, buffer, sz); +} + + +int Client::Read(void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast<opaque*>(buffer)); + return receiveData(*pimpl_->base_.ssl_, data); +} + + +void Client::SetCA(const char* name) +{ + NewCopy(pimpl_->base_.ca_, name); +} + + +void Client::SetCert(const char* name) +{ + NewCopy(pimpl_->base_.cert_, name); +} + + +void Client::SetKey(const char* name) +{ + NewCopy(pimpl_->base_.key_, name); +} + + + +// Server Implementation +struct Server::ServerImpl { + Base base_; +}; + + +Server::Server() : pimpl_(new ServerImpl) +{} + + +Server::~Server() { delete pimpl_; } + + +int Server::Accept(SOCKET_T s) +{ + SetUpBase(pimpl_->base_, server_end, s); + return SSL_accept(pimpl_->base_.ssl_); +} + + +int Server::Write(const void* buffer, int sz) +{ + return sendData(*pimpl_->base_.ssl_, buffer, sz); +} + + +int Server::Read(void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast<opaque*>(buffer)); + return receiveData(*pimpl_->base_.ssl_, data); +} + + +void Server::SetCA(const char* name) +{ + NewCopy(pimpl_->base_.ca_, name); +} + + +void Server::SetCert(const char* name) +{ + NewCopy(pimpl_->base_.cert_, name); +} + + +void Server::SetKey(const char* name) +{ + NewCopy(pimpl_->base_.key_, name); +} + + + +} // namespace yaSSL Modified: dcplusplus/trunk/yassl/src/yassl_imp.cpp =================================================================== --- dcplusplus/trunk/yassl/src/yassl_imp.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/src/yassl_imp.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -29,6 +29,7 @@ #include "asn.hpp" // provide crypto wrapper?? + namespace yaSSL { @@ -111,11 +112,15 @@ uint keyLength = dhClient.get_agreedKeyLength(); // pub and agree same alloc(keyLength, true); - dhClient.makeAgreement(dhServer.get_publicKey()); + dhClient.makeAgreement(dhServer.get_publicKey(), keyLength); c16toa(keyLength, Yc_); memcpy(Yc_ + KEY_OFFSET, dhClient.get_publicKey(), keyLength); - ssl.set_preMaster(dhClient.get_agreedKey(), keyLength); + // because of encoding first byte might be zero, don't use it for preMaster + if (*dhClient.get_agreedKey() == 0) + ssl.set_preMaster(dhClient.get_agreedKey() + 1, keyLength - 1); + else + ssl.set_preMaster(dhClient.get_agreedKey(), keyLength); } @@ -269,10 +274,14 @@ ato16(tmp, keyLength); alloc(keyLength); - input.read(Yc_, length_); - dh.makeAgreement(Yc_); + input.read(Yc_, keyLength); + dh.makeAgreement(Yc_, keyLength); - ssl.set_preMaster(dh.get_agreedKey(), keyLength); + // because of encoding, first byte might be 0, don't use for preMaster + if (*dh.get_agreedKey() == 0) + ssl.set_preMaster(dh.get_agreedKey() + 1, dh.get_agreedKeyLength() - 1); + else + ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength()); ssl.makeMasterSecret(); } @@ -438,7 +447,7 @@ int i = 0; // available suites, best first // when adding more, make sure cipher_names is updated and - // MAX_CIPHER_LIST is big enough + // MAX_CIPHERS is big enough if (isTLS(pv)) { suites_[i++] = 0x00; @@ -510,13 +519,10 @@ for (int j = 0; j < suites; j++) { int index = suites_[j*2 + 1]; // every other suite is suite id - int len = strlen(cipher_names[index]); - memcpy(&cipher_list_[pos], cipher_names[index], len); - pos += len; - cipher_list_[pos++] = ':'; + int len = strlen(cipher_names[index]) + 1; + strncpy(cipher_list_[pos++], cipher_names[index], len); } - if (suites) - cipher_list_[--pos] = 0; + cipher_list_[pos][0] = 0; } @@ -1630,8 +1636,11 @@ // CertificateRequest processing handler void CertificateRequest::Process(input_buffer&, SSL& ssl) { - if (ssl.useCrypto().use_certManager().get_cert()) - ssl.useCrypto().use_certManager().setSendVerify(); + CertManager& cm = ssl.useCrypto().use_certManager(); + + // make sure user provided cert and key before sending and using + if (cm.get_cert() && cm.get_privateKey()) + cm.setSendVerify(); } Modified: dcplusplus/trunk/yassl/src/yassl_int.cpp =================================================================== --- dcplusplus/trunk/yassl/src/yassl_int.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/src/yassl_int.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -832,7 +832,7 @@ int length = 2 * secure_.get_parms().hash_size_ + 2 * secure_.get_parms().key_size_ + 2 * secure_.get_parms().iv_size_; - int rounds = length / MD5_LEN + ((length % MD5_LEN) ? 1 : 0); + int rounds = (length + MD5_LEN - 1 ) / MD5_LEN; input_buffer key_data(rounds * MD5_LEN); opaque sha_output[SHA_LEN]; Modified: dcplusplus/trunk/yassl/taocrypt/include/asn.hpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/include/asn.hpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/include/asn.hpp 2006-04-30 12:13:44 UTC (rev 600) @@ -184,7 +184,7 @@ word32 sz_; public: explicit PublicKey(const byte* k = 0, word32 s = 0); - ~PublicKey() { tcDelete(key_); } + ~PublicKey() { tcArrayDelete(key_); } const byte* GetKey() const { return key_; } word32 size() const { return sz_; } Modified: dcplusplus/trunk/yassl/taocrypt/include/dh.hpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/include/dh.hpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/include/dh.hpp 2006-04-30 12:13:44 UTC (rev 600) @@ -64,7 +64,7 @@ } void GenerateKeyPair(RandomNumberGenerator&, byte*, byte*); - void Agree(byte*, const byte*, const byte*); + void Agree(byte*, const byte*, const byte*, word32 otherSz = 0); void SetP(const Integer& p) { p_ = p; } void SetG(const Integer& g) { g_ = g; } Modified: dcplusplus/trunk/yassl/taocrypt/src/aes.cpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/src/aes.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/src/aes.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -478,9 +478,9 @@ AS2( mov ebp, DWORD PTR [ebp + 20] ) #define EPILOG() \ + AS2( mov esi, [ebp - 4] ) \ AS2( mov esp, ebp ) \ AS2( movd ebx, mm4 ) \ - AS2( mov esi, [ebp - 4] ) \ AS2( movd edi, mm3 ) \ AS1( emms ) \ asm(".att_syntax"); Modified: dcplusplus/trunk/yassl/taocrypt/src/arc4.cpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/src/arc4.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/src/arc4.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -80,7 +80,6 @@ void ARC4::Process(byte* out, const byte* in, word32 length) { - //AsmProcess(out, in, length); if (length == 0) return; byte *const s = state_; @@ -202,7 +201,7 @@ AS2( movzx eax, BYTE PTR [ebp + ecx] ) // xOr w/ inByte - AS2( xor ebx, [esi] ) + AS2( xor bl, BYTE PTR [esi] ) AS1( inc esi ) // write to outByte Modified: dcplusplus/trunk/yassl/taocrypt/src/coding.cpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/src/coding.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/src/coding.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -130,7 +130,7 @@ word32 outSz = bytes * 4 / 3; outSz += (outSz % 4); // 4 byte integrals - outSz += outSz / pemLineSz + ( (outSz % pemLineSz) ? 1 : 0); // new lines + outSz += (outSz + pemLineSz - 1) / pemLineSz; // new lines encoded_.New(outSz); word32 i = 0; @@ -187,9 +187,8 @@ void Base64Decoder::Decode() { word32 bytes = coded_.size(); - word32 plainSz = bytes - (bytes / pemLineSz + ( (bytes % pemLineSz) ? - 1 : 0)); - plainSz = plainSz * 3 / 4 + (( (plainSz * 3) % 4) ? 1 : 0); + word32 plainSz = bytes - ((bytes + (pemLineSz - 1)) / pemLineSz); + plainSz = (plainSz * 3 + 3) / 4; decoded_.New(plainSz); word32 i = 0; Modified: dcplusplus/trunk/yassl/taocrypt/src/dh.cpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/src/dh.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/src/dh.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -26,10 +26,26 @@ #include "runtime.hpp" #include "dh.hpp" #include "asn.hpp" +#include <math.h> namespace TaoCrypt { +namespace { // locals + +unsigned int DiscreteLogWorkFactor(unsigned int n) +{ + // assuming discrete log takes about the same time as factoring + if (n<5) + return 0; + else + return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * + pow(log(double(n)), 2.0/3.0) - 5); +} + +} // namespace locals + + // Generate a DH Key Pair void DH::GenerateKeyPair(RandomNumberGenerator& rng, byte* priv, byte* pub) { @@ -41,7 +57,8 @@ // Generate private value void DH::GeneratePrivate(RandomNumberGenerator& rng, byte* priv) { - Integer x(rng, Integer::One(), p_ - 1); + Integer x(rng, Integer::One(), mySTL::min(p_ - 1, + Integer::Power2(2*DiscreteLogWorkFactor(p_.BitCount())) ) ); x.Encode(priv, p_.ByteCount()); } @@ -57,11 +74,16 @@ // Generate Agreement -void DH::Agree(byte* agree, const byte* priv, const byte* otherPub) +void DH::Agree(byte* agree, const byte* priv, const byte* otherPub, word32 + otherSz) { const word32 bc(p_.ByteCount()); Integer x(priv, bc); - Integer y(otherPub, bc); + Integer y; + if (otherSz) + y.Decode(otherPub, otherSz); + else + y.Decode(otherPub, bc); Integer z(a_exp_b_mod_c(y, x, p_)); z.Encode(agree, bc); Modified: dcplusplus/trunk/yassl/taocrypt/src/random.cpp =================================================================== --- dcplusplus/trunk/yassl/taocrypt/src/random.cpp 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/taocrypt/src/random.cpp 2006-04-30 12:13:44 UTC (rev 600) @@ -26,7 +26,9 @@ #include "runtime.hpp" #include "random.hpp" +#include <string.h> + #if defined(_WIN32) #define _WIN32_WINNT 0x0400 #include <windows.h> @@ -52,6 +54,7 @@ // place a generated block in output void RandomNumberGenerator::GenerateBlock(byte* output, word32 sz) { + memset(output, 0, sz); cipher_.Process(output, output, sz); } Modified: dcplusplus/trunk/yassl/yassl.vcproj =================================================================== --- dcplusplus/trunk/yassl/yassl.vcproj 2006-04-30 11:09:50 UTC (rev 599) +++ dcplusplus/trunk/yassl/yassl.vcproj 2006-04-30 12:13:44 UTC (rev 600) @@ -312,6 +312,9 @@ </FileConfiguration> </File> <File + RelativePath=".\src\yassl.cpp"> + </File> + <File RelativePath="src\yassl_error.cpp"> <FileConfiguration Name="Debug|Win32"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-05-03 21:51:00
|
Revision: 601 Author: arnetheduck Date: 2006-05-03 14:47:14 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=601&view=rev Log Message: ----------- patches Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.rc dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/ADLSearch.cpp dcplusplus/trunk/client/ADLSearch.h dcplusplus/trunk/client/AdcCommand.cpp dcplusplus/trunk/client/AdcCommand.h dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/AdcHub.h dcplusplus/trunk/client/BZUtils.cpp dcplusplus/trunk/client/BZUtils.h dcplusplus/trunk/client/BitInputStream.h dcplusplus/trunk/client/BitOutputStream.h dcplusplus/trunk/client/BloomFilter.h dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/BufferedSocket.h dcplusplus/trunk/client/CID.h dcplusplus/trunk/client/Client.cpp dcplusplus/trunk/client/Client.h dcplusplus/trunk/client/ClientManager.cpp dcplusplus/trunk/client/ClientManager.h dcplusplus/trunk/client/ClientManagerListener.h dcplusplus/trunk/client/ConnectionManager.cpp dcplusplus/trunk/client/ConnectionManager.h dcplusplus/trunk/client/ConnectionManagerListener.h dcplusplus/trunk/client/CriticalSection.h dcplusplus/trunk/client/CryptoManager.cpp dcplusplus/trunk/client/CryptoManager.h dcplusplus/trunk/client/DCPlusPlus.cpp dcplusplus/trunk/client/DCPlusPlus.h dcplusplus/trunk/client/DirectoryListing.cpp dcplusplus/trunk/client/DirectoryListing.h dcplusplus/trunk/client/DownloadManager.cpp dcplusplus/trunk/client/DownloadManager.h dcplusplus/trunk/client/Encoder.cpp dcplusplus/trunk/client/Encoder.h dcplusplus/trunk/client/Exception.h dcplusplus/trunk/client/FastAlloc.h dcplusplus/trunk/client/FavoriteManager.cpp dcplusplus/trunk/client/FavoriteManager.h dcplusplus/trunk/client/FavoriteUser.h dcplusplus/trunk/client/File.h dcplusplus/trunk/client/FilteredFile.h dcplusplus/trunk/client/FinishedManager.cpp dcplusplus/trunk/client/FinishedManager.h dcplusplus/trunk/client/HashManager.cpp dcplusplus/trunk/client/HashManager.h dcplusplus/trunk/client/HashValue.h dcplusplus/trunk/client/HttpConnection.cpp dcplusplus/trunk/client/HttpConnection.h dcplusplus/trunk/client/LogManager.cpp dcplusplus/trunk/client/LogManager.h dcplusplus/trunk/client/MerkleCheckOutputStream.h dcplusplus/trunk/client/MerkleTree.h dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/NmdcHub.h dcplusplus/trunk/client/Pointer.h dcplusplus/trunk/client/QueueItem.h dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/QueueManager.h dcplusplus/trunk/client/QueueManagerListener.h dcplusplus/trunk/client/ResourceManager.cpp dcplusplus/trunk/client/ResourceManager.h dcplusplus/trunk/client/SFVReader.cpp dcplusplus/trunk/client/SFVReader.h dcplusplus/trunk/client/SearchManager.cpp dcplusplus/trunk/client/SearchManager.h dcplusplus/trunk/client/SearchManagerListener.h dcplusplus/trunk/client/Semaphore.h dcplusplus/trunk/client/ServerSocket.cpp dcplusplus/trunk/client/ServerSocket.h dcplusplus/trunk/client/SettingsManager.cpp dcplusplus/trunk/client/SettingsManager.h dcplusplus/trunk/client/ShareManager.cpp dcplusplus/trunk/client/ShareManager.h dcplusplus/trunk/client/SimpleXML.cpp dcplusplus/trunk/client/SimpleXML.h dcplusplus/trunk/client/Singleton.h dcplusplus/trunk/client/Socket.cpp dcplusplus/trunk/client/Socket.h dcplusplus/trunk/client/Speaker.h dcplusplus/trunk/client/Streams.h dcplusplus/trunk/client/StringSearch.h dcplusplus/trunk/client/StringTokenizer.cpp dcplusplus/trunk/client/StringTokenizer.h dcplusplus/trunk/client/Text.cpp dcplusplus/trunk/client/Text.h dcplusplus/trunk/client/Thread.cpp dcplusplus/trunk/client/Thread.h dcplusplus/trunk/client/TigerHash.cpp dcplusplus/trunk/client/TigerHash.h dcplusplus/trunk/client/TimerManager.cpp dcplusplus/trunk/client/TimerManager.h dcplusplus/trunk/client/UploadManager.cpp dcplusplus/trunk/client/UploadManager.h dcplusplus/trunk/client/User.cpp dcplusplus/trunk/client/User.h dcplusplus/trunk/client/UserCommand.h dcplusplus/trunk/client/UserConnection.cpp dcplusplus/trunk/client/UserConnection.h dcplusplus/trunk/client/Util.cpp dcplusplus/trunk/client/Util.h dcplusplus/trunk/client/ZUtils.cpp dcplusplus/trunk/client/ZUtils.h dcplusplus/trunk/client/config.h dcplusplus/trunk/client/stdinc.cpp dcplusplus/trunk/client/stdinc.h dcplusplus/trunk/client/version.h dcplusplus/trunk/windows/ADLSProperties.cpp dcplusplus/trunk/windows/ADLSProperties.h dcplusplus/trunk/windows/ADLSearchFrame.cpp dcplusplus/trunk/windows/ADLSearchFrame.h dcplusplus/trunk/windows/AboutDlg.h dcplusplus/trunk/windows/Advanced3Page.cpp dcplusplus/trunk/windows/Advanced3Page.h dcplusplus/trunk/windows/AdvancedPage.cpp dcplusplus/trunk/windows/AdvancedPage.h dcplusplus/trunk/windows/Appearance2Page.cpp dcplusplus/trunk/windows/Appearance2Page.h dcplusplus/trunk/windows/AppearancePage.cpp dcplusplus/trunk/windows/AppearancePage.h dcplusplus/trunk/windows/CertificatesPage.cpp dcplusplus/trunk/windows/CertificatesPage.h dcplusplus/trunk/windows/CommandDlg.cpp dcplusplus/trunk/windows/CommandDlg.h dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/DownloadPage.cpp dcplusplus/trunk/windows/DownloadPage.h dcplusplus/trunk/windows/ExListViewCtrl.cpp dcplusplus/trunk/windows/ExListViewCtrl.h dcplusplus/trunk/windows/ExtendedTrace.cpp dcplusplus/trunk/windows/ExtendedTrace.h dcplusplus/trunk/windows/FavHubProperties.cpp dcplusplus/trunk/windows/FavHubProperties.h dcplusplus/trunk/windows/FavoriteDirsPage.cpp dcplusplus/trunk/windows/FavoriteDirsPage.h dcplusplus/trunk/windows/FavoritesFrm.cpp dcplusplus/trunk/windows/FavoritesFrm.h dcplusplus/trunk/windows/FinishedFrame.h dcplusplus/trunk/windows/FinishedFrameBase.h dcplusplus/trunk/windows/FinishedULFrame.h dcplusplus/trunk/windows/FlatTabCtrl.h dcplusplus/trunk/windows/GeneralPage.cpp dcplusplus/trunk/windows/GeneralPage.h dcplusplus/trunk/windows/HashProgressDlg.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/LineDlg.h dcplusplus/trunk/windows/ListViewArrows.h dcplusplus/trunk/windows/LogPage.cpp dcplusplus/trunk/windows/LogPage.h dcplusplus/trunk/windows/MagnetDlg.h dcplusplus/trunk/windows/MainFrm.cpp dcplusplus/trunk/windows/MainFrm.h dcplusplus/trunk/windows/NetworkPage.cpp dcplusplus/trunk/windows/NetworkPage.h dcplusplus/trunk/windows/NotepadFrame.cpp dcplusplus/trunk/windows/NotepadFrame.h dcplusplus/trunk/windows/PrivateFrame.cpp dcplusplus/trunk/windows/PrivateFrame.h dcplusplus/trunk/windows/PropPage.cpp dcplusplus/trunk/windows/PropPage.h dcplusplus/trunk/windows/PropertiesDlg.cpp dcplusplus/trunk/windows/PropertiesDlg.h dcplusplus/trunk/windows/PublicHubsFrm.cpp dcplusplus/trunk/windows/PublicHubsFrm.h dcplusplus/trunk/windows/PublicHubsListDlg.h dcplusplus/trunk/windows/QueueFrame.cpp dcplusplus/trunk/windows/QueueFrame.h dcplusplus/trunk/windows/QueuePage.cpp dcplusplus/trunk/windows/QueuePage.h dcplusplus/trunk/windows/SearchFrm.cpp dcplusplus/trunk/windows/SearchFrm.h dcplusplus/trunk/windows/SingleInstance.h dcplusplus/trunk/windows/SpyFrame.cpp dcplusplus/trunk/windows/SpyFrame.h dcplusplus/trunk/windows/StatsFrame.cpp dcplusplus/trunk/windows/StatsFrame.h dcplusplus/trunk/windows/SystemFrame.cpp dcplusplus/trunk/windows/SystemFrame.h dcplusplus/trunk/windows/TextFrame.cpp dcplusplus/trunk/windows/TextFrame.h dcplusplus/trunk/windows/TransferView.cpp dcplusplus/trunk/windows/TransferView.h dcplusplus/trunk/windows/TreePropertySheet.cpp dcplusplus/trunk/windows/TreePropertySheet.h dcplusplus/trunk/windows/TypedListViewCtrl.h dcplusplus/trunk/windows/UCHandler.h dcplusplus/trunk/windows/UCPage.cpp dcplusplus/trunk/windows/UCPage.h dcplusplus/trunk/windows/UPnP.cpp dcplusplus/trunk/windows/UPnP.h dcplusplus/trunk/windows/UploadPage.cpp dcplusplus/trunk/windows/UploadPage.h dcplusplus/trunk/windows/UsersFrame.cpp dcplusplus/trunk/windows/UsersFrame.h dcplusplus/trunk/windows/WaitingUsersFrame.cpp dcplusplus/trunk/windows/WaitingUsersFrame.h dcplusplus/trunk/windows/WinUtil.cpp dcplusplus/trunk/windows/WinUtil.h dcplusplus/trunk/windows/WindowsPage.cpp dcplusplus/trunk/windows/WindowsPage.h dcplusplus/trunk/windows/main.cpp dcplusplus/trunk/windows/stdafx.cpp dcplusplus/trunk/windows/stdafx.h dcplusplus/trunk/yassl/src/yassl.cpp dcplusplus/trunk/zlib/adler32.c dcplusplus/trunk/zlib/compress.c dcplusplus/trunk/zlib/crc32.c dcplusplus/trunk/zlib/deflate.c dcplusplus/trunk/zlib/deflate.h dcplusplus/trunk/zlib/trees.c dcplusplus/trunk/zlib/uncompr.c dcplusplus/trunk/zlib/zconf.h dcplusplus/trunk/zlib/zutil.c dcplusplus/trunk/zlib/zutil.h Modified: dcplusplus/trunk/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/DCPlusPlus.rc 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/DCPlusPlus.rc 2006-05-03 21:47:14 UTC (rev 601) @@ -933,8 +933,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,8,9 - PRODUCTVERSION 0,6,8,9 + FILEVERSION 0,6,9,0 + PRODUCTVERSION 0,6,9,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -951,12 +951,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 6, 8, 9" + VALUE "FileVersion", "0, 6, 9, 0" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 6, 8, 9" + VALUE "ProductVersion", "0, 6, 9, 0" END END BLOCK "VarFileInfo" Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/changelog.txt 2006-05-03 21:47:14 UTC (rev 601) @@ -7,6 +7,7 @@ * CID of user shown if nick is missing (in queue for example) * Added display of CID in a few places * Updated yaSSL to 1.2.2 +* Fixed ADC hubname display (thanks ullner) -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off Modified: dcplusplus/trunk/client/ADLSearch.cpp =================================================================== --- dcplusplus/trunk/client/ADLSearch.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ADLSearch.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -321,8 +321,3 @@ } StepUpDirectory(aDestList); } - -/** - * @file - * $Id: ADLSearch.cpp,v 1.31 2006/02/05 17:02:37 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ADLSearch.h =================================================================== --- dcplusplus/trunk/client/ADLSearch.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ADLSearch.h 2006-05-03 21:47:14 UTC (rev 601) @@ -308,8 +308,3 @@ }; #endif // !defined(ADL_SEARCH_H) - -/** - * @file - * $Id: ADLSearch.h,v 1.25 2006/01/23 08:00:49 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/AdcCommand.cpp =================================================================== --- dcplusplus/trunk/client/AdcCommand.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/AdcCommand.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -222,8 +222,3 @@ } return false; } - -/** - * @file - * $Id: AdcCommand.cpp,v 1.18 2006/02/19 20:39:20 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/AdcCommand.h =================================================================== --- dcplusplus/trunk/client/AdcCommand.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/AdcCommand.h 2006-05-03 21:47:14 UTC (rev 601) @@ -201,8 +201,3 @@ }; #endif // !defined(ADC_COMMAND_H) - -/** - * @file - * $Id: AdcCommand.h,v 1.29 2006/02/19 20:39:20 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -132,8 +132,10 @@ u->getUser()->setFlag(User::SSL); } - if(u->getIdentity().isHub()) + if(u->getIdentity().isHub()) { setHubIdentity(u->getIdentity()); + fire(ClientListener::HubUpdated(), this); + } if(u->getUser() == ClientManager::getInstance()->getMe()) { state = STATE_NORMAL; @@ -540,8 +542,3 @@ sendUDP(cmd); send(cmd.toString(sid)); } - -/** - * @file - * $Id: AdcHub.cpp,v 1.66 2006/02/12 18:16:12 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/AdcHub.h =================================================================== --- dcplusplus/trunk/client/AdcHub.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/AdcHub.h 2006-05-03 21:47:14 UTC (rev 601) @@ -122,8 +122,3 @@ }; #endif // !defined(ADC_HUB_H) - -/** - * @file - * $Id: AdcHub.h,v 1.42 2006/02/19 20:39:20 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BZUtils.cpp =================================================================== --- dcplusplus/trunk/client/BZUtils.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BZUtils.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -99,8 +99,3 @@ insize = insize - zs.avail_in; return err == BZ_OK; } - -/** - * @file - * $Id: BZUtils.cpp,v 1.6 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BZUtils.h =================================================================== --- dcplusplus/trunk/client/BZUtils.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BZUtils.h 2006-05-03 21:47:14 UTC (rev 601) @@ -64,8 +64,3 @@ }; #endif // !defined(BZ_UTILS_H) - -/** - * @file - * $Id: BZUtils.h,v 1.6 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BitInputStream.h =================================================================== --- dcplusplus/trunk/client/BitInputStream.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BitInputStream.h 2006-05-03 21:47:14 UTC (rev 601) @@ -66,8 +66,3 @@ }; #endif // !defined(BIT_INPUT_STREAM_H) - -/** - * @file - * $Id: BitInputStream.h,v 1.18 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BitOutputStream.h =================================================================== --- dcplusplus/trunk/client/BitOutputStream.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BitOutputStream.h 2006-05-03 21:47:14 UTC (rev 601) @@ -58,8 +58,3 @@ }; #endif // !defined(BIT_OUTPUT_STREAM_H) - -/** - * @file - * $Id: BitOutputStream.h,v 1.16 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BloomFilter.h =================================================================== --- dcplusplus/trunk/client/BloomFilter.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BloomFilter.h 2006-05-03 21:47:14 UTC (rev 601) @@ -91,8 +91,3 @@ }; #endif // !defined(BLOOM_FILTER_H) - -/** - * @file - * $Id: BloomFilter.h,v 1.11 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -468,8 +468,3 @@ delete this; } } - -/** - * @file - * $Id: BufferedSocket.cpp,v 1.103 2006/02/19 23:51:31 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/BufferedSocket.h =================================================================== --- dcplusplus/trunk/client/BufferedSocket.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/BufferedSocket.h 2006-05-03 21:47:14 UTC (rev 601) @@ -187,8 +187,3 @@ }; #endif // !defined(BUFFERED_SOCKET_H) - -/** - * @file - * $Id: BufferedSocket.h,v 1.79 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/CID.h =================================================================== --- dcplusplus/trunk/client/CID.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/CID.h 2006-05-03 21:47:14 UTC (rev 601) @@ -61,8 +61,3 @@ }; #endif // !defined(CID_H) - -/** - * @file - * $Id: CID.h,v 1.10 2006/02/10 07:56:46 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Client.cpp =================================================================== --- dcplusplus/trunk/client/Client.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Client.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -145,8 +145,3 @@ return Util::getLocalIp(); return lip; } - -/** - * @file - * $Id: Client.cpp,v 1.94 2006/02/19 23:51:31 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Client.h =================================================================== --- dcplusplus/trunk/client/Client.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Client.h 2006-05-03 21:47:14 UTC (rev 601) @@ -205,8 +205,3 @@ }; #endif // !defined(CLIENT_H) - -/** - * @file - * $Id: Client.h,v 1.111 2006/02/19 23:51:31 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ClientManager.cpp =================================================================== --- dcplusplus/trunk/client/ClientManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ClientManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -571,8 +571,3 @@ if(clients.size() > 0) cachedIp = (*clients.begin())->getLocalIp(); } - -/** - * @file - * $Id: ClientManager.cpp,v 1.97 2006/02/19 23:51:31 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ClientManager.h =================================================================== --- dcplusplus/trunk/client/ClientManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ClientManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -167,8 +167,3 @@ }; #endif // !defined(CLIENT_MANAGER_H) - -/** - * @file - * $Id: ClientManager.h,v 1.78 2006/02/13 21:13:27 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ClientManagerListener.h =================================================================== --- dcplusplus/trunk/client/ClientManagerListener.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ClientManagerListener.h 2006-05-03 21:47:14 UTC (rev 601) @@ -48,8 +48,3 @@ }; #endif // !defined(CLIENT_MANAGER_LISTENER_H) - -/** - * @file - * $Id: ClientManagerListener.h,v 1.13 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ConnectionManager.cpp =================================================================== --- dcplusplus/trunk/client/ConnectionManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ConnectionManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -697,8 +697,3 @@ } } } - -/** - * @file - * $Id: ConnectionManager.cpp,v 1.119 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ConnectionManager.h =================================================================== --- dcplusplus/trunk/client/ConnectionManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ConnectionManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -198,8 +198,3 @@ }; #endif // !defined(CONNECTION_MANAGER_H) - -/** - * @file - * $Id: ConnectionManager.h,v 1.77 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ConnectionManagerListener.h =================================================================== --- dcplusplus/trunk/client/ConnectionManagerListener.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ConnectionManagerListener.h 2006-05-03 21:47:14 UTC (rev 601) @@ -44,8 +44,3 @@ }; #endif // !defined(CONNECTION_MANAGER_LISTENER_H) - -/** - * @file - * $Id: ConnectionManagerListener.h,v 1.8 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/CriticalSection.h =================================================================== --- dcplusplus/trunk/client/CriticalSection.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/CriticalSection.h 2006-05-03 21:47:14 UTC (rev 601) @@ -171,8 +171,3 @@ }; #endif // !defined(CRITICAL_SECTION_H) - -/** - * @file - * $Id: CriticalSection.h,v 1.29 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/CryptoManager.cpp =================================================================== --- dcplusplus/trunk/client/CryptoManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/CryptoManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -394,8 +394,3 @@ } bos.skipToByte(); } - -/** - * @file - * $Id: CryptoManager.cpp,v 1.56 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/CryptoManager.h =================================================================== --- dcplusplus/trunk/client/CryptoManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/CryptoManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -124,8 +124,3 @@ }; #endif // !defined(CRYPTO_MANAGER_H) - -/** - * @file - * $Id: CryptoManager.h,v 1.44 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/DCPlusPlus.cpp =================================================================== --- dcplusplus/trunk/client/DCPlusPlus.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/DCPlusPlus.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -111,8 +111,3 @@ TimerManager::deleteInstance(); ResourceManager::deleteInstance(); } - -/** - * @file - * $Id: DCPlusPlus.cpp,v 1.43 2006/02/12 18:16:12 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/DCPlusPlus.h =================================================================== --- dcplusplus/trunk/client/DCPlusPlus.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/DCPlusPlus.h 2006-05-03 21:47:14 UTC (rev 601) @@ -125,8 +125,3 @@ extern void shutdown(); #endif // !defined(DC_PLUS_PLUS_H) - -/** - * @file - * $Id: DCPlusPlus.h,v 1.48 2005/04/24 08:13:36 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/DirectoryListing.cpp =================================================================== --- dcplusplus/trunk/client/DirectoryListing.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/DirectoryListing.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -423,8 +423,3 @@ } return x; } - -/** - * @file - * $Id: DirectoryListing.cpp,v 1.59 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/DirectoryListing.h =================================================================== --- dcplusplus/trunk/client/DirectoryListing.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/DirectoryListing.h 2006-05-03 21:47:14 UTC (rev 601) @@ -176,8 +176,3 @@ inline bool operator==(DirectoryListing::File::Ptr a, const string& b) { return Util::stricmp(a->getName(), b) == 0; } #endif // !defined(DIRECTORY_LISTING_H) - -/** - * @file - * $Id: DirectoryListing.h,v 1.47 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/client/DownloadManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/DownloadManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -941,8 +941,3 @@ QueueManager::getInstance()->putDownload(d, false); checkDownloads(aSource); } - -/** - * @file - * $Id: DownloadManager.cpp,v 1.160 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/DownloadManager.h =================================================================== --- dcplusplus/trunk/client/DownloadManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/DownloadManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -279,8 +279,3 @@ }; #endif // !defined(DOWNLOAD_MANAGER_H) - -/** - * @file - * $Id: DownloadManager.h,v 1.86 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Encoder.cpp =================================================================== --- dcplusplus/trunk/client/Encoder.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Encoder.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -102,8 +102,3 @@ } } } - -/** - * @file - * $Id: Encoder.cpp,v 1.7 2005/04/24 08:13:10 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Encoder.h =================================================================== --- dcplusplus/trunk/client/Encoder.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Encoder.h 2006-05-03 21:47:14 UTC (rev 601) @@ -38,8 +38,3 @@ }; #endif // !defined(ENCODER_H) - -/** - * @file - * $Id: Encoder.h,v 1.6 2005/04/24 08:13:10 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Exception.h =================================================================== --- dcplusplus/trunk/client/Exception.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Exception.h 2006-05-03 21:47:14 UTC (rev 601) @@ -54,8 +54,3 @@ #endif #endif // !defined(EXCEPTION_H) - -/** - * @file - * $Id: Exception.h,v 1.19 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FastAlloc.h =================================================================== --- dcplusplus/trunk/client/FastAlloc.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FastAlloc.h 2006-05-03 21:47:14 UTC (rev 601) @@ -98,8 +98,3 @@ #endif #endif // !defined(FAST_ALLOC_H) - -/** - * @file - * $Id: FastAlloc.h,v 1.11 2005/04/24 08:13:10 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FavoriteManager.cpp =================================================================== --- dcplusplus/trunk/client/FavoriteManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FavoriteManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -681,8 +681,3 @@ if(isFav) fire(FavoriteManagerListener::StatusChanged(), user); } - -/** - * @file - * $Id: FavoriteManager.cpp,v 1.18 2006/02/19 16:19:05 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FavoriteManager.h =================================================================== --- dcplusplus/trunk/client/FavoriteManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FavoriteManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -279,8 +279,3 @@ }; #endif // !defined(FAVORITE_MANAGER_H) - -/** - * @file - * $Id: FavoriteManager.h,v 1.13 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FavoriteUser.h =================================================================== --- dcplusplus/trunk/client/FavoriteUser.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FavoriteUser.h 2006-05-03 21:47:14 UTC (rev 601) @@ -47,8 +47,3 @@ }; #endif // !defined(FAVORITE_USER_H) - -/** - * @file - * $Id: FavoriteUser.h,v 1.15 2005/12/12 08:43:00 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/File.h =================================================================== --- dcplusplus/trunk/client/File.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/File.h 2006-05-03 21:47:14 UTC (rev 601) @@ -432,8 +432,3 @@ }; #endif // !defined(FILE_H) - -/** - * @file - * $Id: File.h,v 1.54 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FilteredFile.h =================================================================== --- dcplusplus/trunk/client/FilteredFile.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FilteredFile.h 2006-05-03 21:47:14 UTC (rev 601) @@ -184,8 +184,3 @@ }; #endif // !defined(FILTERED_FILE_H) - -/** - * @file - * $Id: FilteredFile.h,v 1.14 2005/04/24 09:45:39 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FinishedManager.cpp =================================================================== --- dcplusplus/trunk/client/FinishedManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FinishedManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -93,8 +93,3 @@ fire(FinishedManagerListener::AddedUl(), item); } } - -/** - * @file - * $Id: FinishedManager.cpp,v 1.28 2006/01/01 22:42:54 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/FinishedManager.h =================================================================== --- dcplusplus/trunk/client/FinishedManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/FinishedManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -106,8 +106,3 @@ }; #endif // !defined(FINISHED_MANAGER_H) - -/** - * @file - * $Id: FinishedManager.h,v 1.19 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/HashManager.cpp =================================================================== --- dcplusplus/trunk/client/HashManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/HashManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -675,8 +675,3 @@ } return 0; } - -/** - * @file - * $Id: HashManager.cpp,v 1.52 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/HashManager.h =================================================================== --- dcplusplus/trunk/client/HashManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/HashManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -272,8 +272,3 @@ }; #endif // !defined(HASH_MANAGER_H) - -/** - * @file - * $Id: HashManager.h,v 1.34 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/HashValue.h =================================================================== --- dcplusplus/trunk/client/HashValue.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/HashValue.h 2006-05-03 21:47:14 UTC (rev 601) @@ -58,8 +58,3 @@ }; #endif // !defined(HASH_VALUE_H) - -/** - * @file - * $Id: HashValue.h,v 1.14 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/HttpConnection.cpp =================================================================== --- dcplusplus/trunk/client/HttpConnection.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/HttpConnection.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -158,8 +158,3 @@ void HttpConnection::on(BufferedSocketListener::Data, u_int8_t* aBuf, size_t aLen) throw() { fire(HttpConnectionListener::Data(), this, aBuf, aLen); } - -/** - * @file - * $Id: HttpConnection.cpp,v 1.33 2006/01/21 10:38:01 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/HttpConnection.h =================================================================== --- dcplusplus/trunk/client/HttpConnection.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/HttpConnection.h 2006-05-03 21:47:14 UTC (rev 601) @@ -87,8 +87,3 @@ }; #endif // !defined(HTTP_CONNECTION_H) - -/** - * @file - * $Id: HttpConnection.h,v 1.28 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/LogManager.cpp =================================================================== --- dcplusplus/trunk/client/LogManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/LogManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -20,8 +20,3 @@ #include "DCPlusPlus.h" #include "LogManager.h" - -/** - * @file - * $Id: LogManager.cpp,v 1.9 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/LogManager.h =================================================================== --- dcplusplus/trunk/client/LogManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/LogManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -121,8 +121,3 @@ #define LOG(area, msg) LogManager::getInstance()->log(area, msg) #endif // !defined(LOG_MANAGER_H) - -/** - * @file - * $Id: LogManager.h,v 1.22 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/MerkleCheckOutputStream.h =================================================================== --- dcplusplus/trunk/client/MerkleCheckOutputStream.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/MerkleCheckOutputStream.h 2006-05-03 21:47:14 UTC (rev 601) @@ -113,8 +113,3 @@ }; #endif // !defined(MERKLE_CHECK_OUTPUT_STREAM_H) - -/** - * @file - * $Id: MerkleCheckOutputStream.h,v 1.5 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/MerkleTree.h =================================================================== --- dcplusplus/trunk/client/MerkleTree.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/MerkleTree.h 2006-05-03 21:47:14 UTC (rev 601) @@ -227,8 +227,3 @@ }; #endif // !defined(MERKLE_TREE_H) - -/** - * @file - * $Id: MerkleTree.h,v 1.27 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -808,9 +808,3 @@ fire(ClientListener::Failed(), this, aLine); } - -/** - * @file - * $Id: NmdcHub.cpp,v 1.55 2006/02/19 20:39:20 arnetheduck Exp $ - */ - Modified: dcplusplus/trunk/client/NmdcHub.h =================================================================== --- dcplusplus/trunk/client/NmdcHub.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/NmdcHub.h 2006-05-03 21:47:14 UTC (rev 601) @@ -127,8 +127,3 @@ }; #endif // !defined(NMDC_HUB_H) - -/** - * @file - * $Id: NmdcHub.h,v 1.33 2006/02/19 23:51:31 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Pointer.h =================================================================== --- dcplusplus/trunk/client/Pointer.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Pointer.h 2006-05-03 21:47:14 UTC (rev 601) @@ -163,8 +163,3 @@ }; #endif // !defined(POINTER_H) - -/** - * @file - * $Id: Pointer.h,v 1.22 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/QueueItem.h =================================================================== --- dcplusplus/trunk/client/QueueItem.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/QueueItem.h 2006-05-03 21:47:14 UTC (rev 601) @@ -279,8 +279,3 @@ }; #endif // !defined(QUEUE_ITEM_H) - -/** - * @file - * $Id: QueueItem.h,v 1.25 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -1385,8 +1385,3 @@ saveQueue(); } } - -/** - * @file - * $Id: QueueManager.cpp,v 1.146 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/QueueManager.h =================================================================== --- dcplusplus/trunk/client/QueueManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/QueueManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -234,8 +234,3 @@ }; #endif // !defined(QUEUE_MANAGER_H) - -/** - * @file - * $Id: QueueManager.h,v 1.75 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/QueueManagerListener.h =================================================================== --- dcplusplus/trunk/client/QueueManagerListener.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/QueueManagerListener.h 2006-05-03 21:47:14 UTC (rev 601) @@ -50,8 +50,3 @@ }; #endif // !defined(QUEUE_MANAGER_LISTENER_H) - -/** - * @file - * $Id: QueueManagerListener.h,v 1.12 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ResourceManager.cpp =================================================================== --- dcplusplus/trunk/client/ResourceManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ResourceManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -67,8 +67,3 @@ Text::utf8ToWide(strings[i], wstrings[i]); } } - -/** - * @file - * $Id: ResourceManager.cpp,v 1.15 2006/01/05 00:11:31 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ResourceManager.h =================================================================== --- dcplusplus/trunk/client/ResourceManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ResourceManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -77,8 +77,3 @@ #endif // !defined(RESOURCE_MANAGER_H) - -/** - * @file - * $Id: ResourceManager.h,v 1.17 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SFVReader.cpp =================================================================== --- dcplusplus/trunk/client/SFVReader.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SFVReader.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -98,8 +98,3 @@ #endif } - -/** - * @file - * $Id: SFVReader.cpp,v 1.11 2005/04/24 08:13:37 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SFVReader.h =================================================================== --- dcplusplus/trunk/client/SFVReader.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SFVReader.h 2006-05-03 21:47:14 UTC (rev 601) @@ -54,8 +54,3 @@ }; #endif // !defined(SFV_READER_H) - -/** - * @file - * $Id: SFVReader.h,v 1.7 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SearchManager.cpp =================================================================== --- dcplusplus/trunk/client/SearchManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SearchManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -366,8 +366,3 @@ return tmp; } - -/** - * @file - * $Id: SearchManager.cpp,v 1.67 2006/02/13 21:13:27 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SearchManager.h =================================================================== --- dcplusplus/trunk/client/SearchManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SearchManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -187,8 +187,3 @@ }; #endif // !defined(SEARCH_MANAGER_H) - -/** - * @file - * $Id: SearchManager.h,v 1.59 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SearchManagerListener.h =================================================================== --- dcplusplus/trunk/client/SearchManagerListener.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SearchManagerListener.h 2006-05-03 21:47:14 UTC (rev 601) @@ -35,8 +35,3 @@ }; #endif // !defined(SEARCH_MANAGER_LISTENER_H) - -/** - * @file - * $Id: SearchManagerListener.h,v 1.9 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Semaphore.h =================================================================== --- dcplusplus/trunk/client/Semaphore.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Semaphore.h 2006-05-03 21:47:14 UTC (rev 601) @@ -96,8 +96,3 @@ }; #endif // !defined(SEMAPHORE_H) - -/** - * @file - * $Id: Semaphore.h,v 1.15 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ServerSocket.cpp =================================================================== --- dcplusplus/trunk/client/ServerSocket.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ServerSocket.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -30,8 +30,3 @@ socket.bind(aPort, SETTING(BIND_ADDRESS)); socket.listen(); } - -/** - * @file - * $Id: ServerSocket.cpp,v 1.18 2005/11/27 19:19:20 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ServerSocket.h =================================================================== --- dcplusplus/trunk/client/ServerSocket.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ServerSocket.h 2006-05-03 21:47:14 UTC (rev 601) @@ -58,8 +58,3 @@ }; #endif // !defined(SERVER_SOCKET_H) - -/** - * @file - * $Id: ServerSocket.h,v 1.29 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/client/SettingsManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SettingsManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -420,8 +420,3 @@ // ... } } - -/** - * @file - * $Id: SettingsManager.cpp,v 1.142 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SettingsManager.h =================================================================== --- dcplusplus/trunk/client/SettingsManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SettingsManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -204,8 +204,3 @@ #define BOOLSETTING(k) (SettingsManager::getInstance()->getBool(SettingsManager::k, true)) #endif // !defined(SETTINGS_MANAGER_H) - -/** - * @file - * $Id: SettingsManager.h,v 1.112 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ShareManager.cpp =================================================================== --- dcplusplus/trunk/client/ShareManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ShareManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -1518,8 +1518,3 @@ } } } - -/** - * @file - * $Id: ShareManager.cpp,v 1.145 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ShareManager.h =================================================================== --- dcplusplus/trunk/client/ShareManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ShareManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -329,8 +329,3 @@ }; #endif // !defined(SHARE_MANAGER_H) - -/** - * @file - * $Id: ShareManager.h,v 1.87 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SimpleXML.cpp =================================================================== --- dcplusplus/trunk/client/SimpleXML.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SimpleXML.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -330,8 +330,3 @@ current = &root; resetCurrentChild(); } - -/** - * @file - * $Id: SimpleXML.cpp,v 1.32 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/SimpleXML.h =================================================================== --- dcplusplus/trunk/client/SimpleXML.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/SimpleXML.h 2006-05-03 21:47:14 UTC (rev 601) @@ -281,8 +281,3 @@ }; #endif // !defined(SIMPLE_XML_H) - -/** - * @file - * $Id: SimpleXML.h,v 1.46 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Singleton.h =================================================================== --- dcplusplus/trunk/client/Singleton.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Singleton.h 2006-05-03 21:47:14 UTC (rev 601) @@ -57,8 +57,3 @@ template<class T> T* Singleton<T>::instance = NULL; #endif // !defined(SINGLETON_H) - -/** - * @file - * $Id: Singleton.h,v 1.10 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Socket.cpp =================================================================== --- dcplusplus/trunk/client/Socket.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Socket.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -580,8 +580,3 @@ shutdown(); close(); } - -/** - * @file - * $Id: Socket.cpp,v 1.72 2005/12/16 01:00:46 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Socket.h =================================================================== --- dcplusplus/trunk/client/Socket.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Socket.h 2006-05-03 21:47:14 UTC (rev 601) @@ -246,8 +246,3 @@ }; #endif // !defined(SOCKET_H) - -/** - * @file - * $Id: Socket.h,v 1.67 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Speaker.h =================================================================== --- dcplusplus/trunk/client/Speaker.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Speaker.h 2006-05-03 21:47:14 UTC (rev 601) @@ -122,8 +122,3 @@ }; #endif // !defined(SPEAKER_H) - -/** - * @file - * $Id: Speaker.h,v 1.10 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Streams.h =================================================================== --- dcplusplus/trunk/client/Streams.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Streams.h 2006-05-03 21:47:14 UTC (rev 601) @@ -192,8 +192,3 @@ #endif // !defined(STREAMS_H) - -/** - * @file - * $Id: Streams.h,v 1.7 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/StringSearch.h =================================================================== --- dcplusplus/trunk/client/StringSearch.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/StringSearch.h 2006-05-03 21:47:14 UTC (rev 601) @@ -115,8 +115,3 @@ }; #endif // !defined(STRING_SEARCH_H) - -/** - * @file - * $Id: StringSearch.h,v 1.10 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/StringTokenizer.cpp =================================================================== --- dcplusplus/trunk/client/StringTokenizer.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/StringTokenizer.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -20,8 +20,3 @@ #include "DCPlusPlus.h" #include "StringTokenizer.h" - -/** - * @file - * $Id: StringTokenizer.cpp,v 1.12 2005/04/24 08:13:36 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/StringTokenizer.h =================================================================== --- dcplusplus/trunk/client/StringTokenizer.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/StringTokenizer.h 2006-05-03 21:47:14 UTC (rev 601) @@ -58,8 +58,3 @@ }; #endif // !defined(STRING_TOKENIZER_H) - -/** - * @file - * $Id: StringTokenizer.h,v 1.10 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Text.cpp =================================================================== --- dcplusplus/trunk/client/Text.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Text.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -259,8 +259,3 @@ } return tmp; } - -/** - * @file - * $Id: Text.cpp,v 1.11 2005/12/03 20:36:49 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Text.h =================================================================== --- dcplusplus/trunk/client/Text.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Text.h 2006-05-03 21:47:14 UTC (rev 601) @@ -124,8 +124,3 @@ }; #endif // !defined(TEXT_H) - -/** - * @file - * $Id: Text.h,v 1.9 2005/04/24 08:13:10 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Thread.cpp =================================================================== --- dcplusplus/trunk/client/Thread.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Thread.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -39,8 +39,3 @@ } } #endif - -/** - * @file - * $Id: Thread.cpp,v 1.10 2005/04/24 08:13:36 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Thread.h =================================================================== --- dcplusplus/trunk/client/Thread.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Thread.h 2006-05-03 21:47:14 UTC (rev 601) @@ -145,8 +145,3 @@ }; #endif // !defined(THREAD_H) - -/** - * @file - * $Id: Thread.h,v 1.23 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/TigerHash.cpp =================================================================== --- dcplusplus/trunk/client/TigerHash.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/TigerHash.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -679,8 +679,3 @@ _ULL(0xCD56D9430EA8280E) /* 1020 */, _ULL(0xC12591D7535F5065) /* 1021 */, _ULL(0xC83223F1720AEF96) /* 1022 */, _ULL(0xC3A0396F7363A51F) /* 1023 */ }; - -/** - * @file - * $Id: TigerHash.cpp,v 1.7 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/TigerHash.h =================================================================== --- dcplusplus/trunk/client/TigerHash.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/TigerHash.h 2006-05-03 21:47:14 UTC (rev 601) @@ -58,8 +58,3 @@ }; #endif // !defined(TIGER_HASH_H) - -/** - * @file - * $Id: TigerHash.h,v 1.9 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/TimerManager.cpp =================================================================== --- dcplusplus/trunk/client/TimerManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/TimerManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -44,8 +44,3 @@ return 0; } - -/** - * @file - * $Id: TimerManager.cpp,v 1.19 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/TimerManager.h =================================================================== --- dcplusplus/trunk/client/TimerManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/TimerManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -92,8 +92,3 @@ #define GET_TIME() TimerManager::getTime() #endif // !defined(TIMER_MANAGER_H) - -/** - * @file - * $Id: TimerManager.h,v 1.30 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/UploadManager.cpp =================================================================== --- dcplusplus/trunk/client/UploadManager.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/UploadManager.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -513,8 +513,3 @@ clearUserFiles(aUser); } } - -/** - * @file - * $Id: UploadManager.cpp,v 1.104 2006/02/05 17:02:38 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/UploadManager.h =================================================================== --- dcplusplus/trunk/client/UploadManager.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/UploadManager.h 2006-05-03 21:47:14 UTC (rev 601) @@ -196,8 +196,3 @@ }; #endif // !defined(UPLOAD_MANAGER_H) - -/** - * @file - * $Id: UploadManager.h,v 1.86 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/User.cpp =================================================================== --- dcplusplus/trunk/client/User.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/User.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -63,8 +63,3 @@ } return false; } - -/** - * @file - * $Id: User.cpp,v 1.53 2006/02/17 19:23:51 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/User.h =================================================================== --- dcplusplus/trunk/client/User.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/User.h 2006-05-03 21:47:14 UTC (rev 601) @@ -185,8 +185,3 @@ }; #endif // !defined(USER_H) - -/** - * @file - * $Id: User.h,v 1.71 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/UserCommand.h =================================================================== --- dcplusplus/trunk/client/UserCommand.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/UserCommand.h 2006-05-03 21:47:14 UTC (rev 601) @@ -75,8 +75,3 @@ }; #endif // !defined(USER_COMMAND_H) - -/** - * @file - * $Id: UserCommand.h,v 1.14 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/UserConnection.cpp =================================================================== --- dcplusplus/trunk/client/UserConnection.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/UserConnection.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -206,8 +206,3 @@ delete this; } - -/** - * @file - * $Id: UserConnection.cpp,v 1.58 2006/02/12 18:16:12 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/UserConnection.h =================================================================== --- dcplusplus/trunk/client/UserConnection.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/UserConnection.h 2006-05-03 21:47:14 UTC (rev 601) @@ -361,8 +361,3 @@ }; #endif // !defined(USER_CONNECTION_H) - -/** - * @file - * $Id: UserConnection.h,v 1.107 2006/02/19 17:19:04 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Util.cpp =================================================================== --- dcplusplus/trunk/client/Util.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Util.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -945,8 +945,3 @@ } return tmp2; } - -/** - * @file - * $Id: Util.cpp,v 1.95 2006/02/18 23:32:17 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/Util.h =================================================================== --- dcplusplus/trunk/client/Util.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/Util.h 2006-05-03 21:47:14 UTC (rev 601) @@ -605,8 +605,3 @@ }; #endif // !defined(UTIL_H) - -/** - * @file - * $Id: Util.h,v 1.128 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ZUtils.cpp =================================================================== --- dcplusplus/trunk/client/ZUtils.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ZUtils.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -125,8 +125,3 @@ insize = insize - zs.avail_in; return err == Z_OK; } - -/** - * @file - * $Id: ZUtils.cpp,v 1.10 2006/01/29 18:48:25 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/ZUtils.h =================================================================== --- dcplusplus/trunk/client/ZUtils.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/ZUtils.h 2006-05-03 21:47:14 UTC (rev 601) @@ -80,8 +80,3 @@ }; #endif // !defined(_Z_UTILS_H) - -/** - * @file - * $Id: ZUtils.h,v 1.8 2005/04/24 08:13:11 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/config.h =================================================================== --- dcplusplus/trunk/client/config.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/config.h 2006-05-03 21:47:14 UTC (rev 601) @@ -128,8 +128,3 @@ #endif #endif // !defined(CONFIG_H) - -/** - * @file - * $Id: config.h,v 1.41 2006/02/13 21:13:27 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/stdinc.cpp =================================================================== --- dcplusplus/trunk/client/stdinc.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/stdinc.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -29,8 +29,3 @@ #endif #endif // HAS_STLPORT - -/** - * @file - * $Id: stdinc.cpp,v 1.8 2005/04/24 08:13:36 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/stdinc.h =================================================================== --- dcplusplus/trunk/client/stdinc.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/stdinc.h 2006-05-03 21:47:14 UTC (rev 601) @@ -133,8 +133,3 @@ #endif // __GLIBCPP__ #endif // !defined(STDINC_H) - -/** - * @file - * $Id: stdinc.h,v 1.22 2006/02/18 23:32:17 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/client/version.h =================================================================== --- dcplusplus/trunk/client/version.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/client/version.h 2006-05-03 21:47:14 UTC (rev 601) @@ -17,8 +17,8 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.689" -#define VERSIONFLOAT 0.689 +#define VERSIONSTRING "0.69" +#define VERSIONFLOAT 0.69 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/windows/ADLSProperties.cpp =================================================================== --- dcplusplus/trunk/windows/ADLSProperties.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/ADLSProperties.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -99,8 +99,3 @@ EndDialog(wID); return 0; } - -/** - * @file - * $Id: ADLSProperties.cpp,v 1.10 2005/04/24 08:13:03 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/ADLSProperties.h =================================================================== --- dcplusplus/trunk/windows/ADLSProperties.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/ADLSProperties.h 2006-05-03 21:47:14 UTC (rev 601) @@ -59,8 +59,3 @@ }; #endif // !defined(ADLS_PROPERTIES_H) - -/** - * @file - * $Id: ADLSProperties.h,v 1.5 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/ADLSearchFrame.cpp =================================================================== --- dcplusplus/trunk/windows/ADLSearchFrame.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/ADLSearchFrame.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -546,8 +546,3 @@ // Update 'Active' check box ctrlList.SetCheckState(index, search.isActive); } - -/** - * @file - * $Id: ADLSearchFrame.cpp,v 1.26 2005/11/28 01:21:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/ADLSearchFrame.h =================================================================== --- dcplusplus/trunk/windows/ADLSearchFrame.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/ADLSearchFrame.h 2006-05-03 21:47:14 UTC (rev 601) @@ -145,8 +145,3 @@ }; #endif // !defined(ADL_SEARCH_FRAME_H) - -/** - * @file - * $Id: ADLSearchFrame.h,v 1.13 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/AboutDlg.h =================================================================== --- dcplusplus/trunk/windows/AboutDlg.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/AboutDlg.h 2006-05-03 21:47:14 UTC (rev 601) @@ -128,8 +128,3 @@ }; #endif // !defined(ABOUT_DLG_H) - -/** - * @file - * $Id: AboutDlg.h,v 1.58 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/Advanced3Page.cpp =================================================================== --- dcplusplus/trunk/windows/Advanced3Page.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/Advanced3Page.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -100,8 +100,3 @@ HtmlHelp(m_hWnd, WinUtil::getHelpFile().c_str(), HH_HELP_CONTEXT, IDD_ADVANCED3PAGE); return 0; } - -/** - * @file - * $Id: Advanced3Page.cpp,v 1.14 2006/02/10 07:56:47 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/Advanced3Page.h =================================================================== --- dcplusplus/trunk/windows/Advanced3Page.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/Advanced3Page.h 2006-05-03 21:47:14 UTC (rev 601) @@ -58,8 +58,3 @@ }; #endif // !defined(ADVANCED3_PAGE_H) - -/** - * @file - * $Id: Advanced3Page.h,v 1.5 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/AdvancedPage.cpp =================================================================== --- dcplusplus/trunk/windows/AdvancedPage.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/AdvancedPage.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -72,8 +72,3 @@ HtmlHelp(m_hWnd, WinUtil::getHelpFile().c_str(), HH_HELP_CONTEXT, IDD_ADVANCEDPAGE); return 0; } - -/** - * @file - * $Id: AdvancedPage.cpp,v 1.58 2006/01/06 14:44:32 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/AdvancedPage.h =================================================================== --- dcplusplus/trunk/windows/AdvancedPage.h 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/AdvancedPage.h 2006-05-03 21:47:14 UTC (rev 601) @@ -57,8 +57,3 @@ }; #endif // !defined(ADVANCED_PAGE_H) - -/** - * @file - * $Id: AdvancedPage.h,v 1.16 2006/02/19 16:19:06 arnetheduck Exp $ - */ Modified: dcplusplus/trunk/windows/Appearance2Page.cpp =================================================================== --- dcplusplus/trunk/windows/Appearance2Page.cpp 2006-04-30 12:13:44 UTC (rev 600) +++ dcplusplus/trunk/windows/Appearance2Page.cpp 2006-05-03 21:47:14 UTC (rev 601) @@ -176,8 +176,3 @@ HtmlHelp(m_hWnd, WinUtil::getHelpFile().c_str(), HH_HELP_CONTEXT, ... [truncated message content] |
From: <arn...@us...> - 2006-05-13 15:01:01
|
Revision: 602 Author: arnetheduck Date: 2006-05-13 08:00:16 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=602&view=rev Log Message: ----------- Patches Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/DownloadManager.cpp dcplusplus/trunk/client/SettingsManager.cpp dcplusplus/trunk/client/SettingsManager.h dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/StringDefs.h dcplusplus/trunk/client/UploadManager.cpp dcplusplus/trunk/windows/AdvancedPage.cpp Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/Example.xml 2006-05-13 15:00:16 UTC (rev 602) @@ -379,6 +379,7 @@ <String Name="SettingsAutoAway">Auto-away on minimize (and back on restore)</String> <String Name="SettingsAutoFollow">Automatically follow redirects</String> <String Name="SettingsAutoKick">Automatically disconnect users who leave the hub</String> + <String Name="SettingsAutoKickNoFavs">Don't automatically disconnect favorite users who leave the hub</String> <String Name="SettingsAutoSearch">Automatically search for alternative download locations</String> <String Name="SettingsAutoSearchAutoMatch">Automatically match queue for auto search hits</String> <String Name="SettingsAutoSearchLimit">Auto-search limit</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/changelog.txt 2006-05-13 15:00:16 UTC (rev 602) @@ -8,6 +8,9 @@ * Added display of CID in a few places * Updated yaSSL to 1.2.2 * Fixed ADC hubname display (thanks ullner) +* Advanced TTH rollback no longer performed if tree is invalid (thanks garg) +* Option not to auto-disconnect favorite users (thanks ullner) +* Fixed auto-disconnect delay (thanks uller) -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off Modified: dcplusplus/trunk/client/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/client/DownloadManager.cpp 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/client/DownloadManager.cpp 2006-05-13 15:00:16 UTC (rev 602) @@ -266,7 +266,9 @@ d->setFlag(Download::FLAG_ANTI_FRAG); } - if(BOOLSETTING(ADVANCED_RESUME) && d->getTreeValid() && start > 0) { + if(BOOLSETTING(ADVANCED_RESUME) && d->getTreeValid() && start > 0 && + (d->getTigerTree().getLeaves().size() > 32 || // 32 leaves is 5 levels + d->getTigerTree().getBlockSize() * 10 < d->getSize())) { d->setStartPos(getResumePos(d->getDownloadTarget(), d->getTigerTree(), start)); } else { int rollback = SETTING(ROLLBACK); Modified: dcplusplus/trunk/client/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/client/SettingsManager.cpp 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/client/SettingsManager.cpp 2006-05-13 15:00:16 UTC (rev 602) @@ -73,7 +73,7 @@ "NoIpOverride", "SearchOnlyFreeSlots", "LastSearchType", "BoldFinishedDownloads", "BoldFinishedUploads", "BoldQueue", "BoldHub", "BoldPm", "BoldSearch", "SocketInBuffer", "SocketOutBuffer", "OnlyDlTthFiles", "OpenWaitingUsers", "BoldWaitingUsers", "OpenSystemLog", "BoldSystemLog", "AutoRefreshTime", - "UseSsl", "AutoSearchLimit", "AltSortOrder", + "UseSsl", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -255,6 +255,7 @@ setDefault(USE_SSL, false); setDefault(AUTO_SEARCH_LIMIT, 5); setDefault(ALT_SORT_ORDER, false); + setDefault(AUTO_KICK_NO_FAVS, false); #ifdef _WIN32 setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); Modified: dcplusplus/trunk/client/SettingsManager.h =================================================================== --- dcplusplus/trunk/client/SettingsManager.h 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/client/SettingsManager.h 2006-05-13 15:00:16 UTC (rev 602) @@ -89,7 +89,7 @@ NO_IP_OVERRIDE, SEARCH_ONLY_FREE_SLOTS, LAST_SEARCH_TYPE, BOLD_FINISHED_DOWNLOADS, BOLD_FINISHED_UPLOADS, BOLD_QUEUE, BOLD_HUB, BOLD_PM, BOLD_SEARCH, SOCKET_IN_BUFFER, SOCKET_OUT_BUFFER, ONLY_DL_TTH_FILES, OPEN_WAITING_USERS, BOLD_WAITING_USERS, OPEN_SYSTEM_LOG, BOLD_SYSTEM_LOG, AUTO_REFRESH_TIME, - USE_SSL, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, + USE_SSL, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-05-13 15:00:16 UTC (rev 602) @@ -380,6 +380,7 @@ "Auto-away on minimize (and back on restore)", "Automatically follow redirects", "Automatically disconnect users who leave the hub", +"Don't automatically disconnect favorite users who leave the hub", "Automatically search for alternative download locations", "Automatically match queue for auto search hits", "Auto-search limit", @@ -983,6 +984,7 @@ "SettingsAutoAway", "SettingsAutoFollow", "SettingsAutoKick", +"SettingsAutoKickNoFavs", "SettingsAutoSearch", "SettingsAutoSearchAutoMatch", "SettingsAutoSearchLimit", Modified: dcplusplus/trunk/client/StringDefs.h =================================================================== --- dcplusplus/trunk/client/StringDefs.h 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/client/StringDefs.h 2006-05-13 15:00:16 UTC (rev 602) @@ -383,6 +383,7 @@ SETTINGS_AUTO_AWAY, // "Auto-away on minimize (and back on restore)" SETTINGS_AUTO_FOLLOW, // "Automatically follow redirects" SETTINGS_AUTO_KICK, // "Automatically disconnect users who leave the hub" + SETTINGS_AUTO_KICK_NO_FAVS, // "Don't automatically disconnect favorite users who leave the hub" SETTINGS_AUTO_SEARCH, // "Automatically search for alternative download locations" SETTINGS_AUTO_SEARCH_AUTO_MATCH, // "Automatically match queue for auto search hits" SETTINGS_AUTO_SEARCH_LIMIT, // "Auto-search limit" Modified: dcplusplus/trunk/client/UploadManager.cpp =================================================================== --- dcplusplus/trunk/client/UploadManager.cpp 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/client/UploadManager.cpp 2006-05-13 15:00:16 UTC (rev 602) @@ -492,14 +492,14 @@ void UploadManager::on(ClientManagerListener::UserDisconnected, const User::Ptr& aUser) throw() { /// @todo Don't kick when /me disconnects - if( BOOLSETTING(AUTO_KICK) ) { + if( BOOLSETTING(AUTO_KICK) && !(BOOLSETTING(AUTO_KICK_NO_FAVS) && FavoriteManager::getInstance()->isFavoriteUser(aUser)) ) { Lock l(cs); for(Upload::Iter i = uploads.begin(); i != uploads.end(); ++i) { Upload* u = *i; if(u->getUser() == aUser) { // Oops...adios... - u->getUserConnection()->disconnect(); + u->getUserConnection()->disconnect(true); // But let's grant him/her a free slot just in case... if (!u->getUserConnection()->isSet(UserConnection::FLAG_HASEXTRASLOT)) reserveSlot(aUser); Modified: dcplusplus/trunk/windows/AdvancedPage.cpp =================================================================== --- dcplusplus/trunk/windows/AdvancedPage.cpp 2006-05-03 21:47:14 UTC (rev 601) +++ dcplusplus/trunk/windows/AdvancedPage.cpp 2006-05-13 15:00:16 UTC (rev 602) @@ -48,6 +48,7 @@ { SettingsManager::ADD_FINISHED_INSTANTLY, ResourceManager::SETTINGS_ADD_FINISHED_INSTANTLY }, { SettingsManager::USE_CTRL_FOR_LINE_HISTORY, ResourceManager::SETTINGS_USE_CTRL_FOR_LINE_HISTORY }, { SettingsManager::USE_SSL, ResourceManager::SETTINGS_USE_SSL }, + { SettingsManager::AUTO_KICK_NO_FAVS, ResourceManager::SETTINGS_AUTO_KICK_NO_FAVS }, { 0, ResourceManager::SETTINGS_AUTO_AWAY } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-05-15 21:53:37
|
Revision: 603 Author: arnetheduck Date: 2006-05-15 14:53:14 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=603&view=rev Log Message: ----------- User command fixes Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/ClientManager.cpp dcplusplus/trunk/client/FavoriteManager.cpp dcplusplus/trunk/client/User.cpp dcplusplus/trunk/client/User.h dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/PrivateFrame.cpp dcplusplus/trunk/windows/PrivateFrame.h dcplusplus/trunk/windows/SearchFrm.cpp dcplusplus/trunk/windows/SearchFrm.h dcplusplus/trunk/windows/SingleInstance.h dcplusplus/trunk/windows/TransferView.cpp dcplusplus/trunk/windows/TransferView.h Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/Example.xml 2006-05-15 21:53:14 UTC (rev 603) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.689" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.69" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/changelog.txt 2006-05-15 21:53:14 UTC (rev 603) @@ -11,6 +11,9 @@ * Advanced TTH rollback no longer performed if tree is invalid (thanks garg) * Option not to auto-disconnect favorite users (thanks ullner) * Fixed auto-disconnect delay (thanks uller) +* Another fix for opencow +* Fixed user command parameters not being remembered +* Fixed ADC op commands -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -336,9 +336,9 @@ short port = secure ? ConnectionManager::getInstance()->getSecurePort() : ConnectionManager::getInstance()->getPort(); if(ClientManager::getInstance()->isActive()) { - send(AdcCommand(AdcCommand::CMD_CTM, user.getSID()).addParam(proto).addParam(Util::toString(port)).addParam(token)); + send(AdcCommand(AdcCommand::CMD_CTM, user.getIdentity().getSID()).addParam(proto).addParam(Util::toString(port)).addParam(token)); } else { - send(AdcCommand(AdcCommand::CMD_RCM, user.getSID()).addParam(proto)); + send(AdcCommand(AdcCommand::CMD_RCM, user.getIdentity().getSID()).addParam(proto)); } } @@ -357,7 +357,7 @@ void AdcHub::privateMessage(const OnlineUser& user, const string& aMessage) { if(state != STATE_NORMAL) return; - send(AdcCommand(AdcCommand::CMD_MSG, user.getSID()).addParam(aMessage).addParam("PM", getMySID())); + send(AdcCommand(AdcCommand::CMD_MSG, user.getIdentity().getSID()).addParam(aMessage).addParam("PM", getMySID())); } void AdcHub::search(int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken) { Modified: dcplusplus/trunk/client/ClientManager.cpp =================================================================== --- dcplusplus/trunk/client/ClientManager.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/client/ClientManager.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -316,7 +316,7 @@ if(cmd.getType() == AdcCommand::TYPE_UDP && !u->getIdentity().isUdpActive()) { cmd.setType(AdcCommand::TYPE_DIRECT); } - cmd.setTo(u->getSID()); + cmd.setTo(u->getIdentity().getSID()); u->getClient().send(cmd); } } @@ -404,7 +404,7 @@ if(i != onlineUsers.end()) { return i->second->getIdentity(); } - return Identity(aUser, Util::emptyString); + return Identity(aUser, Util::emptyString, 0); } void ClientManager::search(int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken) { Modified: dcplusplus/trunk/client/FavoriteManager.cpp =================================================================== --- dcplusplus/trunk/client/FavoriteManager.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/client/FavoriteManager.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -408,11 +408,10 @@ // Add ADC standard op commands static const char adc_disconnectstr[] = - "HDSC %[mycid] %[cid] DI ND Friendly\\ disconnect\n"; + "HDSC %[userSID]\n"; addUserCommand(UserCommand::TYPE_RAW_ONCE, UserCommand::CONTEXT_CHAT | UserCommand::CONTEXT_SEARCH, UserCommand::FLAG_NOSAVE, STRING(DISCONNECT_USER), adc_disconnectstr, "adc://op"); - try { SimpleXML xml; xml.fromXML(File(getConfigFile(), File::READ, File::OPEN).read()); @@ -600,11 +599,11 @@ } UserCommand::List FavoriteManager::getUserCommands(int ctx, const StringList& hubs) { - bool isOp = false; - for(StringIterC i = hubs.begin(); i != hubs.end(); ++i) { - if(ClientManager::getInstance()->isOp(ClientManager::getInstance()->getMe(), *i)) { - isOp = true; - break; + vector<bool> isOp(hubs.size()); + + for(size_t i = 0; i < hubs.size(); ++i) { + if(ClientManager::getInstance()->isOp(ClientManager::getInstance()->getMe(), hubs[i])) { + isOp[i] = true; } } @@ -612,14 +611,32 @@ UserCommand::List lst; for(UserCommand::Iter i = userCommands.begin(); i != userCommands.end(); ++i) { UserCommand& uc = *i; - if( (uc.getCtx() & ctx) && - ( uc.getHub().empty() || - (uc.getHub() == "op" && isOp) || - (find_if(hubs.begin(), hubs.end(), bind1st(equal_to<string>(), uc.getHub())) != hubs.end()) - ) ) - { - lst.push_back(*i); + if(!(uc.getCtx() & ctx)) { + continue; } + + for(size_t j = 0; j < hubs.size(); ++j) { + const string& hub = hubs[j]; + bool hubAdc = hub.compare(0, 6, "adc://") == 0; + bool commandAdc = uc.getHub().compare(0, 6, "adc://") == 0; + if(hubAdc && commandAdc) { + if((uc.getHub().length() == 6) || + (uc.getHub() == "adc://op" && isOp[j]) || + (uc.getHub() == hub) ) + { + lst.push_back(*i); + break; + } + } else if(!hubAdc && !commandAdc) { + if((uc.getHub().length() == 0) || + (uc.getHub() == "op" && isOp[j]) || + (uc.getHub() == hub) ) + { + lst.push_back(*i); + break; + } + } + } } return lst; } Modified: dcplusplus/trunk/client/User.cpp =================================================================== --- dcplusplus/trunk/client/User.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/client/User.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -23,7 +23,7 @@ #include "Client.h" #include "StringTokenizer.h" -OnlineUser::OnlineUser(const User::Ptr& ptr, Client& client_, u_int32_t sid_) : user(ptr), identity(ptr, client_.getHubUrl()), sid(sid_), client(&client_) { +OnlineUser::OnlineUser(const User::Ptr& ptr, Client& client_, u_int32_t sid_) : user(ptr), identity(ptr, client_.getHubUrl(), sid_), client(&client_) { } @@ -32,6 +32,7 @@ sm[prefix + string((char*)(&i->first), 2)] = i->second; } if(user) { + sm[prefix + "SID"] = getSIDString(); sm[prefix + "CID"] = user->getCID().toBase32(); sm[prefix + "TAG"] = getTag(); sm[prefix + "SSshort"] = Util::formatBytes(get("SS")); Modified: dcplusplus/trunk/client/User.h =================================================================== --- dcplusplus/trunk/client/User.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/client/User.h 2006-05-15 21:53:14 UTC (rev 603) @@ -97,10 +97,10 @@ NMDC_PASSIVE = 1 << NMDC_PASSIVE_BIT }; - Identity() { } - Identity(const User::Ptr& ptr, const string& aHubUrl) : user(ptr), hubUrl(aHubUrl) { } - Identity(const Identity& rhs) : ::Flags(rhs), user(rhs.user), hubUrl(rhs.hubUrl), info(rhs.info) { } - Identity& operator=(const Identity& rhs) { user = rhs.user; hubUrl = rhs.hubUrl; info = rhs.info; return *this; } + Identity() : sid(0) { } + Identity(const User::Ptr& ptr, const string& aHubUrl, u_int32_t aSID) : user(ptr), hubUrl(aHubUrl), sid(aSID) { } + Identity(const Identity& rhs) : ::Flags(rhs), user(rhs.user), hubUrl(rhs.hubUrl), sid(rhs.sid), info(rhs.info) { } + Identity& operator=(const Identity& rhs) { user = rhs.user; hubUrl = rhs.hubUrl; sid = rhs.sid; info = rhs.info; return *this; } #define GS(n, x) const string& get##n() const { return get(x); } void set##n(const string& v) { set(x, v); } GS(Nick, "NI") @@ -143,10 +143,15 @@ info[*(short*)name] = val; } + string getSIDString() const { + return string((const char*)&sid, 4); + } + void getParams(StringMap& map, const string& prefix, bool compatibility) const; User::Ptr& getUser() { return user; } GETSET(User::Ptr, user, User); GETSET(string, hubUrl, HubUrl); + GETSET(u_int32_t, sid, SID); private: typedef map<short, string> InfMap; typedef InfMap::iterator InfIter; @@ -174,7 +179,6 @@ GETSET(User::Ptr, user, User); GETSET(Identity, identity, Identity); - GETSET(u_int32_t, sid, SID); private: friend class NmdcHub; Modified: dcplusplus/trunk/windows/DirectoryListingFrm.cpp =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -1035,9 +1035,11 @@ } void DirectoryListingFrame::runUserCommand(UserCommand& uc) { - StringMap ucParams; - if(!WinUtil::getUCParams(m_hWnd, uc, ucParams)) + if(!WinUtil::getUCParams(m_hWnd, uc, ucLineParams)) return; + + StringMap ucParams = ucLineParams; + set<User::Ptr> nicks; int sel = -1; Modified: dcplusplus/trunk/windows/DirectoryListingFrm.h =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-05-15 21:53:14 UTC (rev 603) @@ -345,6 +345,8 @@ auto_ptr<DirectoryListing> dl; + StringMap ucLineParams; + typedef HASH_MAP_X(User::Ptr, DirectoryListingFrame*, User::HashFunction, equal_to<User::Ptr>, less<User::Ptr>) UserMap; typedef UserMap::iterator UserIter; Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -799,10 +799,11 @@ } void HubFrame::runUserCommand(::UserCommand& uc) { - StringMap ucParams; - if(!WinUtil::getUCParams(m_hWnd, uc, ucParams)) + if(!WinUtil::getUCParams(m_hWnd, uc, ucLineParams)) return; + StringMap ucParams = ucLineParams; + client->getMyIdentity().getParams(ucParams, "my", true); client->getHubIdentity().getParams(ucParams, "hub", false); Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/HubFrame.h 2006-05-15 21:53:14 UTC (rev 603) @@ -324,6 +324,8 @@ bool updateUsers; bool resort; + StringMap ucLineParams; + enum { MAX_CLIENT_LINES = 5 }; TStringList lastLinesList; tstring lastLines; Modified: dcplusplus/trunk/windows/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/windows/PrivateFrame.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/PrivateFrame.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -32,6 +32,7 @@ #include "../client/ShareManager.h" #include "../client/FavoriteManager.h" #include "../client/QueueManager.h" +#include "../client/StringTokenizer.h" PrivateFrame::FrameMap PrivateFrame::frames; @@ -284,10 +285,12 @@ } void PrivateFrame::runUserCommand(UserCommand& uc) { - StringMap ucParams; - if(!WinUtil::getUCParams(m_hWnd, uc, ucParams)) + + if(!WinUtil::getUCParams(m_hWnd, uc, ucLineParams)) return; + StringMap ucParams = ucLineParams; + ClientManager::getInstance()->userCommand(replyTo, uc, ucParams, true); } Modified: dcplusplus/trunk/windows/PrivateFrame.h =================================================================== --- dcplusplus/trunk/windows/PrivateFrame.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/PrivateFrame.h 2006-05-15 21:53:14 UTC (rev 603) @@ -161,6 +161,8 @@ bool closed; + StringMap ucLineParams; + void updateTitle(); // ClientManagerListener Modified: dcplusplus/trunk/windows/SearchFrm.cpp =================================================================== --- dcplusplus/trunk/windows/SearchFrm.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/SearchFrm.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -768,9 +768,11 @@ } void SearchFrame::runUserCommand(UserCommand& uc) { - StringMap ucParams; - if(!WinUtil::getUCParams(m_hWnd, uc, ucParams)) + if(!WinUtil::getUCParams(m_hWnd, uc, ucLineParams)) return; + + StringMap ucParams = ucLineParams; + set<CID> users; int sel = -1; Modified: dcplusplus/trunk/windows/SearchFrm.h =================================================================== --- dcplusplus/trunk/windows/SearchFrm.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/SearchFrm.h 2006-05-15 21:53:14 UTC (rev 603) @@ -383,6 +383,8 @@ bool closed; + StringMap ucLineParams; + static int columnIndexes[]; static int columnSizes[]; Modified: dcplusplus/trunk/windows/SingleInstance.h =================================================================== --- dcplusplus/trunk/windows/SingleInstance.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/SingleInstance.h 2006-05-15 21:53:14 UTC (rev 603) @@ -24,7 +24,7 @@ #endif // _MSC_VER > 1000 #define WMU_WHERE_ARE_YOU_MSG _T("WMU_WHERE_ARE_YOU-{885D4B75-6606-4add-A8DE-EEEDC04181F1}") -const UINT WMU_WHERE_ARE_YOU = ::RegisterWindowMessage(_T("WMU_WHERE_ARE_YOU_MSG")); +const UINT WMU_WHERE_ARE_YOU = ::RegisterWindowMessageA("WMU_WHERE_ARE_YOU_MSG"); class SingleInstance { Modified: dcplusplus/trunk/windows/TransferView.cpp =================================================================== --- dcplusplus/trunk/windows/TransferView.cpp 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/TransferView.cpp 2006-05-15 21:53:14 UTC (rev 603) @@ -128,10 +128,11 @@ } void TransferView::runUserCommand(UserCommand& uc) { - StringMap ucParams; - if(!WinUtil::getUCParams(m_hWnd, uc, ucParams)) + if(!WinUtil::getUCParams(m_hWnd, uc, ucLineParams)) return; + StringMap ucParams = ucLineParams; + int i = -1; while((i = ctrlTransfers.GetNextItem(i, LVNI_SELECTED)) != -1) { ItemInfo* itemI = ctrlTransfers.getItemData(i); Modified: dcplusplus/trunk/windows/TransferView.h =================================================================== --- dcplusplus/trunk/windows/TransferView.h 2006-05-13 15:00:16 UTC (rev 602) +++ dcplusplus/trunk/windows/TransferView.h 2006-05-15 21:53:14 UTC (rev 603) @@ -263,6 +263,8 @@ CMenu transferMenu; CImageList arrows; + StringMap ucLineParams; + virtual void on(ConnectionManagerListener::Added, ConnectionQueueItem* aCqi) throw(); virtual void on(ConnectionManagerListener::Failed, ConnectionQueueItem* aCqi, const string& aReason) throw(); virtual void on(ConnectionManagerListener::Removed, ConnectionQueueItem* aCqi) throw(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-05-20 16:17:29
|
Revision: 604 Author: arnetheduck Date: 2006-05-20 09:17:09 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=604&view=rev Log Message: ----------- Bugfixes, patches Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/ClientManager.h dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/SettingsManager.cpp dcplusplus/trunk/client/SettingsManager.h dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/StringDefs.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/MainFrm.cpp dcplusplus/trunk/windows/QueueFrame.cpp dcplusplus/trunk/windows/QueueFrame.h dcplusplus/trunk/windows/WindowsPage.cpp Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/Example.xml 2006-05-20 16:17:09 UTC (rev 604) @@ -462,6 +462,7 @@ <String Name="SettingsPopupOffline">Open private messages from offline users in their own window</String> <String Name="SettingsPopupPms">Open private messages in their own window</String> <String Name="SettingsPorts">Ports</String> + <String Name="SettingsPromptPassword">Popup box to input password for hubs</String> <String Name="SettingsPublicHubList">Public Hubs list</String> <String Name="SettingsPublicHubListHttpProxy">HTTP Proxy (for hublist only)</String> <String Name="SettingsPublicHubListUrl">Public Hubs list URL</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/changelog.txt 2006-05-20 16:17:09 UTC (rev 604) @@ -14,6 +14,9 @@ * Another fix for opencow * Fixed user command parameters not being remembered * Fixed ADC op commands +* [bug 464] Added option for masked password prompt (thanks ullner) +* [bug 922] Updated help links (thanks xan) +* Fixed op count -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -140,6 +140,7 @@ if(u->getUser() == ClientManager::getInstance()->getMe()) { state = STATE_NORMAL; setMyIdentity(u->getIdentity()); + updateCounts(false); } fire(ClientListener::UserUpdated(), this, *u); } Modified: dcplusplus/trunk/client/ClientManager.h =================================================================== --- dcplusplus/trunk/client/ClientManager.h 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/ClientManager.h 2006-05-20 16:17:09 UTC (rev 604) @@ -93,15 +93,6 @@ Client::List& getClients() { return clients; } - void removeClientListener(ClientListener* listener) { - Lock l(cs); - Client::Iter endIt = clients.end(); - for(Client::Iter it = clients.begin(); it != endIt; ++it) { - Client* client = *it; - client->removeListener(listener); - } - } - string getCachedIp() const { Lock l(cs); return cachedIp; } CID getMyCID(); Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -603,7 +603,9 @@ continue; OnlineUser& ou = getUser(*it); ou.getIdentity().setOp(true); - v.push_back(&getUser(*it)); + if(*it == getMyNick()) + getMyIdentity().setOp(true); + v.push_back(&ou); } fire(ClientListener::UsersUpdated(), this, v); Modified: dcplusplus/trunk/client/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/client/SettingsManager.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/SettingsManager.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -73,7 +73,7 @@ "NoIpOverride", "SearchOnlyFreeSlots", "LastSearchType", "BoldFinishedDownloads", "BoldFinishedUploads", "BoldQueue", "BoldHub", "BoldPm", "BoldSearch", "SocketInBuffer", "SocketOutBuffer", "OnlyDlTthFiles", "OpenWaitingUsers", "BoldWaitingUsers", "OpenSystemLog", "BoldSystemLog", "AutoRefreshTime", - "UseSsl", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", + "UseSsl", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "PromptPassword", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -256,6 +256,7 @@ setDefault(AUTO_SEARCH_LIMIT, 5); setDefault(ALT_SORT_ORDER, false); setDefault(AUTO_KICK_NO_FAVS, false); + setDefault(PROMPT_PASSWORD, false); #ifdef _WIN32 setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); Modified: dcplusplus/trunk/client/SettingsManager.h =================================================================== --- dcplusplus/trunk/client/SettingsManager.h 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/SettingsManager.h 2006-05-20 16:17:09 UTC (rev 604) @@ -89,7 +89,7 @@ NO_IP_OVERRIDE, SEARCH_ONLY_FREE_SLOTS, LAST_SEARCH_TYPE, BOLD_FINISHED_DOWNLOADS, BOLD_FINISHED_UPLOADS, BOLD_QUEUE, BOLD_HUB, BOLD_PM, BOLD_SEARCH, SOCKET_IN_BUFFER, SOCKET_OUT_BUFFER, ONLY_DL_TTH_FILES, OPEN_WAITING_USERS, BOLD_WAITING_USERS, OPEN_SYSTEM_LOG, BOLD_SYSTEM_LOG, AUTO_REFRESH_TIME, - USE_SSL, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, + USE_SSL, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -463,6 +463,7 @@ "Open private messages from offline users in their own window", "Open private messages in their own window", "Ports", +"Popup box to input password for hubs", "Public Hubs list", "HTTP Proxy (for hublist only)", "Public Hubs list URL", @@ -1067,6 +1068,7 @@ "SettingsPopupOffline", "SettingsPopupPms", "SettingsPorts", +"SettingsPromptPassword", "SettingsPublicHubList", "SettingsPublicHubListHttpProxy", "SettingsPublicHubListUrl", Modified: dcplusplus/trunk/client/StringDefs.h =================================================================== --- dcplusplus/trunk/client/StringDefs.h 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/client/StringDefs.h 2006-05-20 16:17:09 UTC (rev 604) @@ -466,6 +466,7 @@ SETTINGS_POPUP_OFFLINE, // "Open private messages from offline users in their own window" SETTINGS_POPUP_PMS, // "Open private messages in their own window" SETTINGS_PORTS, // "Ports" + SETTINGS_PROMPT_PASSWORD, // "Popup box to input password for hubs" SETTINGS_PUBLIC_HUB_LIST, // "Public Hubs list" SETTINGS_PUBLIC_HUB_LIST_HTTP_PROXY, // "HTTP Proxy (for hublist only)" SETTINGS_PUBLIC_HUB_LIST_URL, // "Public Hubs list URL" Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -482,10 +482,24 @@ client->password(client->getPassword()); addClientLine(TSTRING(STORED_PASSWORD_SENT)); } else { - ctrlMessage.SetWindowText(_T("/password ")); - ctrlMessage.SetFocus(); - ctrlMessage.SetSel(10, 10); - waitingForPW = true; + if(!BOOLSETTING(PROMPT_PASSWORD)) { + ctrlMessage.SetWindowText(_T("/password ")); + ctrlMessage.SetFocus(); + ctrlMessage.SetSel(10, 10); + waitingForPW = true; + } else { + LineDlg linePwd; + linePwd.title = CTSTRING(ENTER_PASSWORD); + linePwd.description = CTSTRING(ENTER_PASSWORD); + linePwd.password = true; + if(linePwd.DoModal(m_hWnd) == IDOK) { + client->setPassword(Text::fromT(linePwd.line)); + client->password(Text::fromT(linePwd.line)); + waitingForPW = false; + } else { + client->disconnect(true); + } + } } } else if(task->speaker == PRIVATE_MESSAGE) { PMTask& pm = *static_cast<PMTask*>(task); Modified: dcplusplus/trunk/windows/MainFrm.cpp =================================================================== --- dcplusplus/trunk/windows/MainFrm.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/windows/MainFrm.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -57,15 +57,15 @@ { memset(statusSizes, 0, sizeof(statusSizes)); - links.homepage = _T("http://dcplusplus.sourceforge.net/"); + links.homepage = _T("http://dcpp.net/"); links.downloads = links.homepage + _T("download/"); links.geoipfile = _T("http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip"); links.translations = _T("http://sourceforge.net/tracker/?atid=460289&group_id=40287"); - links.faq = links.homepage + _T("faq/faq.php?list=all&prog=1&lang=en"); + links.faq = links.homepage + _T("faq/"); links.help = links.homepage + _T("forum/"); links.discuss = links.homepage + _T("forum/"); - links.features = links.homepage + _T("bugs/"); - links.bugs = links.homepage + _T("bugs/"); + links.features = links.homepage + _T("bugzilla/"); + links.bugs = links.homepage + _T("bugzilla/"); } MainFrame::~MainFrame() { Modified: dcplusplus/trunk/windows/QueueFrame.cpp =================================================================== --- dcplusplus/trunk/windows/QueueFrame.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/windows/QueueFrame.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -1241,6 +1241,15 @@ updateStatus(); } +void QueueFrame::clearTree(HTREEITEM item) { + HTREEITEM next = ctrlDirs.GetChildItem(item); + while(next != NULL) { + clearTree(next); + next = ctrlDirs.GetNextSiblingItem(next); + } + delete (tstring*)ctrlDirs.GetItemData(item); +} + // Put it here to avoid a copy for each recursion... static TCHAR tmpBuf[1024]; void QueueFrame::moveNode(HTREEITEM item, HTREEITEM parent) { Modified: dcplusplus/trunk/windows/QueueFrame.h =================================================================== --- dcplusplus/trunk/windows/QueueFrame.h 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/windows/QueueFrame.h 2006-05-20 16:17:09 UTC (rev 604) @@ -389,14 +389,7 @@ void moveNode(HTREEITEM item, HTREEITEM parent); - void clearTree(HTREEITEM item) { - HTREEITEM next = ctrlDirs.GetChildItem(item); - while(next != NULL) { - clearTree(next); - next = ctrlDirs.GetNextSiblingItem(next); - } - delete (tstring*)ctrlDirs.GetItemData(item); - } + void clearTree(HTREEITEM item); void removeSelected() { if(!BOOLSETTING(CONFIRM_ITEM_REMOVAL) || MessageBox(CTSTRING(REALLY_REMOVE), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) == IDYES) Modified: dcplusplus/trunk/windows/WindowsPage.cpp =================================================================== --- dcplusplus/trunk/windows/WindowsPage.cpp 2006-05-15 21:53:14 UTC (rev 603) +++ dcplusplus/trunk/windows/WindowsPage.cpp 2006-05-20 16:17:09 UTC (rev 604) @@ -58,6 +58,7 @@ { SettingsManager::JOIN_OPEN_NEW_WINDOW, ResourceManager::SETTINGS_OPEN_NEW_WINDOW }, { SettingsManager::IGNORE_OFFLINE, ResourceManager::SETTINGS_IGNORE_OFFLINE }, { SettingsManager::TOGGLE_ACTIVE_WINDOW, ResourceManager::SETTINGS_TOGGLE_ACTIVE_WINDOW }, + { SettingsManager::PROMPT_PASSWORD, ResourceManager::SETTINGS_PROMPT_PASSWORD }, { 0, ResourceManager::SETTINGS_AUTO_AWAY } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-05-21 08:46:08
|
Revision: 605 Author: arnetheduck Date: 2006-05-21 01:45:42 -0700 (Sun, 21 May 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=605&view=rev Log Message: ----------- Bugfixes, removed nmdc file list support Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/CryptoManager.cpp dcplusplus/trunk/client/CryptoManager.h dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/ShareManager.cpp dcplusplus/trunk/client/ShareManager.h dcplusplus/trunk/client/UploadManager.cpp dcplusplus/trunk/client/UserConnection.h dcplusplus/trunk/windows/MainFrm.cpp dcplusplus/trunk/windows/MainFrm.h dcplusplus/trunk/windows/QueueFrame.cpp dcplusplus/trunk/windows/QueueFrame.h dcplusplus/trunk/windows/TransferView.cpp dcplusplus/trunk/windows/WinUtil.h dcplusplus/trunk/windows/main.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/changelog.txt 2006-05-21 08:45:42 UTC (rev 605) @@ -17,6 +17,11 @@ * [bug 464] Added option for masked password prompt (thanks ullner) * [bug 922] Updated help links (thanks xan) * Fixed op count +* [bug 230] Added settings to tray menu +* [bug 403] Unfinished file lists deleted since they're never resumed anyway +* [bug 639] Separated remove user from queue menu option +* [bug 766] Fixed broken app titlebar +* Removed support for generating NMDC-style file lists (old clients won't be able to download from you) -- 0.689 2006-04-01 -- * Fixed displaying of available bytes when user list is off Modified: dcplusplus/trunk/client/CryptoManager.cpp =================================================================== --- dcplusplus/trunk/client/CryptoManager.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/CryptoManager.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -229,168 +229,3 @@ delete[] leaves; delete root; } - -/** - * Counts the occurances of each characters, and adds the total number of - * different characters to the end of the array. - */ -int CryptoManager::countChars(const string& aString, int* c, u_int8_t& csum) { - int chars = 0; - const u_int8_t* a = (const u_int8_t*)aString.data(); - string::size_type len = aString.length(); - for(string::size_type i=0; i<len; i++) { - - if(c[a[i]] == 0) - chars++; - - c[a[i]]++; - csum^=a[i]; - } - return chars; -} - -void CryptoManager::walkTree(list<Node*>& aTree) { - while(aTree.size() > 1) { - // Merge the first two nodes - Node* node = new Node(aTree.front(), *(++aTree.begin())); - aTree.pop_front(); - aTree.pop_front(); - - bool done = false; - for(list<Node*>::iterator i=aTree.begin(); i != aTree.end(); ++i) { - if(*node <= *(*i)) { - aTree.insert(i, node); - done = true; - break; - } - } - - if(!done) - aTree.push_back(node); - - } -} - -void CryptoManager::recurseLookup(vector<u_int8_t>* table, Node* node, vector<u_int8_t>& u_int8_ts) { - if(node->chr != -1) { - table[node->chr] = u_int8_ts; - return; - } - - u_int8_ts.push_back(0); - recurseLookup(table, node->left, u_int8_ts); - u_int8_ts.pop_back(); - - u_int8_ts.push_back(1); - recurseLookup(table, node->right, u_int8_ts); - u_int8_ts.pop_back(); -} - -/** - * Builds a table over the characters available (for fast lookup). - * Stores each character as a set of u_int8_ts with values {0, 1}. - */ -void CryptoManager::buildLookup(vector<u_int8_t>* table, Node* aRoot) { - vector<u_int8_t> left; - vector<u_int8_t> right; - - left.push_back(0); - right.push_back(1); - - recurseLookup(table, aRoot->left, left); - recurseLookup(table, aRoot->right, right); -} - - -struct greaterNode { - bool operator() (const Node* a, const Node* b) const { - return *a < *b; - } -}; - -/** - * Encodes a set of data with DC's version of huffman encoding.. - * @todo Use real streams maybe? or something else than string (operator[] contains a compare, slow...) - */ -void CryptoManager::encodeHuffman(const string& is, string& os) { - - // We might as well expect this much data as huffman encoding doesn't go very far... - os.reserve(is.size()); - if(is.length() == 0) { - os.append("HE3\x0d"); - - // Nada... - os.append(7, '\0'); - return; - } - // First, we count all characters - u_int8_t csum = 0; - int count[256]; - memset(count, 0, sizeof(count)); - int chars = countChars(is, count, csum); - - // Next, we create a set of nodes and add it to a list, removing all characters that never occur. - - list<Node*> nodes; - - int i; - for(i=0; i<256; i++) { - if(count[i] > 0) { - nodes.push_back(new Node(i, count[i])); - } - } - - nodes.sort(greaterNode()); -#ifdef _DEBUG - for(list<Node*>::iterator it = nodes.begin(); it != nodes.end(); ++it) dcdebug("%.02x:%d, ", (*it)->chr, (*it)->weight); - dcdebug("\n"); -#endif - - walkTree(nodes); - dcassert(nodes.size() == 1); - - Node* root = nodes.front(); - vector<u_int8_t> lookup[256]; - - // Build a lookup table for fast character lookups - buildLookup(lookup, root); - delete root; - - // Reserve some memory to avoid all those copies when appending... - os.reserve(is.size() * 3 / 4); - - os.append("HE3\x0d"); - - // Checksum - os.append(1, csum); - string::size_type sz = is.size(); - os.append((char*)&sz, 4); - - // Character count - os.append((char*)&chars, 2); - - // The characters and their bitlengths - for(i=0; i<256; i++) { - if(count[i] > 0) { - os.append(1, (u_int8_t)i); - os.append(1, (u_int8_t)lookup[i].size()); - } - } - - BitOutputStream bos(os); - // The tree itself, ie the bits of each character - for(i=0; i<256; i++) { - if(count[i] > 0) { - bos.put(lookup[i]); - } - } - - dcdebug("u_int8_ts: %lu\n", os.size()); - bos.skipToByte(); - - for(string::size_type j=0; j<is.size(); j++) { - dcassert(lookup[(u_int8_t)is[j]].size() != 0); - bos.put(lookup[(u_int8_t)is[j]]); - } - bos.skipToByte(); -} Modified: dcplusplus/trunk/client/CryptoManager.h =================================================================== --- dcplusplus/trunk/client/CryptoManager.h 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/CryptoManager.h 2006-05-21 08:45:42 UTC (rev 605) @@ -78,7 +78,6 @@ bool isExtended(const string& aLock) { return strncmp(aLock.c_str(), "EXTENDEDPROTOCOL", 16) == 0; } void decodeHuffman(const u_int8_t* /*is*/, string& /*os*/, const size_t /*len*/) throw(CryptoException); - void encodeHuffman(const string& is, string& os); void decodeBZ2(const u_int8_t* is, size_t sz, string& os) throw(CryptoException); private: Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -53,7 +53,7 @@ #include <fnmatch.h> #endif -const string QueueManager::USER_LIST_NAME = "MyList.DcLst"; +const string QueueManager::USER_LIST_NAME = "files.xml"; namespace { const string TEMP_EXTENSION = ".dctmp"; @@ -899,7 +899,7 @@ } } } else if(!aDownload->isSet(Download::FLAG_TREE_DOWNLOAD)) { - if(!aDownload->getTempTarget().empty() && aDownload->getTempTarget() != aDownload->getTarget()) { + if(!aDownload->getTempTarget().empty() && (aDownload->isSet(Download::FLAG_USER_LIST) || aDownload->getTempTarget() != aDownload->getTarget())) { File::deleteFile(aDownload->getTempTarget() + Download::ANTI_FRAG_EXT); File::deleteFile(aDownload->getTempTarget()); } Modified: dcplusplus/trunk/client/ShareManager.cpp =================================================================== --- dcplusplus/trunk/client/ShareManager.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/ShareManager.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -44,8 +44,8 @@ #include <limits> 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) + xmlDirty(true), refreshDirs(false), update(false), initial(true), listN(0), refreshing(0), lFile(NULL), + xFile(NULL), lastXmlUpdate(0), lastFullUpdate(GET_TICK()), bloom(1<<20) { SettingsManager::getInstance()->addListener(this); TimerManager::getInstance()->addListener(this); @@ -80,21 +80,11 @@ FindClose(hFind); } - hFind = FindFirstFile(Text::toT(Util::getConfigPath() + "MyList*.DcLst").c_str(), &data); - if(hFind != INVALID_HANDLE_VALUE) { - do { - File::deleteFile(Util::getAppPath() + Text::fromT(data.cFileName)); - } while(FindNextFile(hFind, &data)); - - FindClose(hFind); - } - #else DIR* dir = opendir(Util::getAppName().c_str()); if (dir) { while (struct dirent* ent = readdir(dir)) { - if (fnmatch("files*.xml.bz2", ent->d_name, 0) == 0 || - fnmatch("MyList*.DcLst", ent->d_name, 0) == 0) { + if (fnmatch("files*.xml.bz2", ent->d_name, 0) == 0) { File::deleteFile(Util::getConfigPath() + ent->d_name); } } @@ -121,21 +111,20 @@ if(i != tthIndex.end()) { return i->second->getADCPath(); } else { - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); } } string ShareManager::translateFileName(const string& aFile) throw(ShareException) { RLock<> l(cs); if(aFile == "MyList.DcLst") { - generateNmdcList(); - return getListFile(); + throw ShareException("NMDC-style lists no longer supported, please upgrade your client"); } else if(aFile == "files.xml.bz2" || aFile == "files.xml") { generateXmlList(); return getBZXmlFile(); } else { if(aFile.length() < 3) - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); string file; @@ -143,25 +132,25 @@ if(aFile.compare(0, 4, "TTH/") == 0) { file = translateTTH(aFile.substr(4)); } else if(aFile[0] != '/') { - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); } else { file = aFile; } string::size_type i = file.find('/', 1); if(i == string::npos) - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); RLock<> l(cs); StringPairIter j = lookupVirtual(file.substr(1, i-1)); if(j == virtualMap.end()) { - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); } file = file.substr(i + 1); Directory::File::Iter it; if(!checkFile(j->second, file, it)) { - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); } #ifdef _WIN32 @@ -193,13 +182,13 @@ } if(aFile.compare(0, 4, "TTH/") != 0) - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); RLock<> l(cs); TTHValue val(aFile.substr(4)); HashFileIter i = tthIndex.find(&val); if(i == tthIndex.end()) { - throw ShareException("File Not Available"); + throw ShareException(UserConnection::FILE_NOT_AVAILABLE); } Directory::File::Iter f = i->second; @@ -888,47 +877,7 @@ lastXmlUpdate = GET_TICK(); } } -void ShareManager::generateNmdcList() { - Lock l(listGenLock); - if(nmdcDirty && (lastNmdcUpdate + 15 * 60 * 1000 < GET_TICK() || lastNmdcUpdate < lastFullUpdate)) { - listN++; - try { - string tmp; - string tmp2; - string indent; - - for(Directory::MapIter i = directories.begin(); i != directories.end(); ++i) { - i->second->toNmdc(tmp, indent, tmp2); - } - - string newName = Util::getConfigPath() + "MyList" + Util::toString(listN) + ".DcLst"; - tmp2.clear(); - CryptoManager::getInstance()->encodeHuffman(tmp, tmp2); - File(newName, File::WRITE, File::CREATE | File::TRUNCATE).write(tmp2); - - if(lFile != NULL) { - delete lFile; - lFile = NULL; - File::deleteFile(getListFile()); - } - try { - File::renameFile(newName, Util::getConfigPath() + "MyList.DcLst"); - newName = Util::getConfigPath() + "MyList.DcLst"; - } catch(const FileException&) { - } - lFile = new File(newName, File::READ, File::OPEN); - setListFile(newName); - listLen = File::getSize(newName); - } catch(const Exception&) { - // No new file lists... - } - - nmdcDirty = false; - lastNmdcUpdate = GET_TICK(); - } -} - MemoryInputStream* ShareManager::generatePartialList(const string& dir, bool recurse) { if(dir[0] != '/' || dir[dir.size()-1] != '/') return NULL; Modified: dcplusplus/trunk/client/ShareManager.h =================================================================== --- dcplusplus/trunk/client/ShareManager.h 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/ShareManager.h 2006-05-21 08:45:42 UTC (rev 605) @@ -61,7 +61,7 @@ string translateFileName(const string& aFile) throw(ShareException); 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 setDirty() { xmlDirty = true; } void search(SearchResult::List& l, const string& aString, int aSearchType, int64_t aSize, int aFileType, Client* aClient, StringList::size_type maxResults); void search(SearchResult::List& l, const StringList& params, StringList::size_type maxResults); @@ -81,9 +81,6 @@ 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); string validateVirtual(const string& /*aVirt*/); @@ -260,7 +257,6 @@ TTHValue xmlRoot; bool xmlDirty; - bool nmdcDirty; bool refreshDirs; bool update; bool initial; @@ -273,7 +269,6 @@ File* xFile; u_int32_t lastXmlUpdate; - u_int32_t lastNmdcUpdate; u_int32_t lastFullUpdate; mutable RWLock<> cs; @@ -297,7 +292,6 @@ Directory* buildTree(const string& aName, Directory* aParent); void addTree(Directory* aDirectory); void addFile(Directory* dir, Directory::File::Iter i); - void generateNmdcList(); void generateXmlList(); bool loadCache(); Modified: dcplusplus/trunk/client/UploadManager.cpp =================================================================== --- dcplusplus/trunk/client/UploadManager.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/UploadManager.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -138,8 +138,8 @@ aSource->fileNotAvail(); return false; } - } catch(const ShareException&) { - aSource->fileNotAvail(); + } catch(const ShareException& e) { + aSource->fileNotAvail(e.getError()); return false; } @@ -409,7 +409,7 @@ } void UploadManager::on(GetListLength, UserConnection* conn) throw() { - conn->listLen(ShareManager::getInstance()->getListLenString()); + conn->listLen("42"); } void UploadManager::on(AdcCommand::GET, UserConnection* aSource, const AdcCommand& c) throw() { Modified: dcplusplus/trunk/client/UserConnection.h =================================================================== --- dcplusplus/trunk/client/UserConnection.h 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/client/UserConnection.h 2006-05-21 08:45:42 UTC (rev 605) @@ -242,7 +242,7 @@ 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)); } + void fileNotAvail(const std::string& msg = Util::emptyString) { isSet(FLAG_NMDC) ? send("$Error " + (msg.empty() ? FILE_NOT_AVAILABLE : msg) + "|") : send(AdcCommand(AdcCommand::SEV_RECOVERABLE, AdcCommand::ERROR_FILE_NOT_AVAILABLE, FILE_NOT_AVAILABLE)); } // ADC Stuff void sup(const StringList& features) { Modified: dcplusplus/trunk/windows/MainFrm.cpp =================================================================== --- dcplusplus/trunk/windows/MainFrm.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/MainFrm.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -959,6 +959,7 @@ mnuTrayMenu.AppendMenu(MF_STRING, IDC_TRAY_SHOW, CTSTRING(MENU_SHOW)); mnuTrayMenu.AppendMenu(MF_STRING, IDC_TRAY_QUIT, CTSTRING(MENU_EXIT)); mnuTrayMenu.AppendMenu(MF_STRING, IDC_OPEN_DOWNLOADS, CTSTRING(MENU_OPEN_DOWNLOADS_DIR)); + mnuTrayMenu.AppendMenu(MF_STRING, ID_FILE_SETTINGS, CTSTRING(MENU_SETTINGS)); GetCursorPos(&pt); SetForegroundWindow(m_hWnd); mnuTrayMenu.TrackPopupMenu(TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,pt.x,pt.y,m_hWnd); Modified: dcplusplus/trunk/windows/MainFrm.h =================================================================== --- dcplusplus/trunk/windows/MainFrm.h 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/MainFrm.h 2006-05-21 08:45:42 UTC (rev 605) @@ -349,7 +349,6 @@ } links; HWND createToolbar(); - void buildMenu(); void updateTray(bool add = true); void autoConnect(const FavoriteHubEntry::List& fl); Modified: dcplusplus/trunk/windows/QueueFrame.cpp =================================================================== --- dcplusplus/trunk/windows/QueueFrame.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/QueueFrame.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -1217,6 +1217,17 @@ return 0; } +void QueueFrame::onTab() { + if(showTree) { + HWND focus = ::GetFocus(); + if(focus == ctrlDirs.m_hWnd) { + ctrlQueue.SetFocus(); + } else if(focus == ctrlQueue.m_hWnd) { + ctrlDirs.SetFocus(); + } + } +} + void QueueFrame::updateQueue() { Lock l(cs); Modified: dcplusplus/trunk/windows/QueueFrame.h =================================================================== --- dcplusplus/trunk/windows/QueueFrame.h 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/QueueFrame.h 2006-05-21 08:45:42 UTC (rev 605) @@ -133,16 +133,7 @@ return 0; } - void onTab() { - if(showTree) { - HWND focus = ::GetFocus(); - if(focus == ctrlDirs.m_hWnd) { - ctrlQueue.SetFocus(); - } else if(focus == ctrlQueue.m_hWnd) { - ctrlDirs.SetFocus(); - } - } - } + void onTab(); LRESULT onShowTree(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) { bHandled = FALSE; Modified: dcplusplus/trunk/windows/TransferView.cpp =================================================================== --- dcplusplus/trunk/windows/TransferView.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/TransferView.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -65,6 +65,7 @@ transferMenu.CreatePopupMenu(); appendUserItems(transferMenu); + transferMenu.AppendMenu(MF_SEPARATOR); transferMenu.AppendMenu(MF_STRING, IDC_FORCE, CTSTRING(FORCE_ATTEMPT)); transferMenu.AppendMenu(MF_STRING, IDC_COPY_NICK, CTSTRING(COPY_NICK)); transferMenu.AppendMenu(MF_SEPARATOR); Modified: dcplusplus/trunk/windows/WinUtil.h =================================================================== --- dcplusplus/trunk/windows/WinUtil.h 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/WinUtil.h 2006-05-21 08:45:42 UTC (rev 605) @@ -124,8 +124,9 @@ menu.AppendMenu(MF_STRING, IDC_PRIVATEMESSAGE, CTSTRING(SEND_PRIVATE_MESSAGE)); menu.AppendMenu(MF_STRING, IDC_ADD_TO_FAVORITES, CTSTRING(ADD_TO_FAVORITES)); menu.AppendMenu(MF_STRING, IDC_GRANTSLOT, CTSTRING(GRANT_EXTRA_SLOT)); + menu.AppendMenu(MF_STRING, IDC_CONNECT, CTSTRING(CONNECT_FAVUSER_HUB)); + menu.AppendMenu(MF_SEPARATOR); menu.AppendMenu(MF_STRING, IDC_REMOVEALL, CTSTRING(REMOVE_FROM_ALL)); - menu.AppendMenu(MF_STRING, IDC_CONNECT, CTSTRING(CONNECT_FAVUSER_HUB)); } }; Modified: dcplusplus/trunk/windows/main.cpp =================================================================== --- dcplusplus/trunk/windows/main.cpp 2006-05-20 16:17:09 UTC (rev 604) +++ dcplusplus/trunk/windows/main.cpp 2006-05-21 08:45:42 UTC (rev 605) @@ -266,7 +266,8 @@ } } - if(wndMain.CreateEx(NULL, rc, 0, WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_WINDOWEDGE) == NULL) { + int rtl = ResourceManager::getInstance()->isRTL() ? WS_EX_RTLREADING : 0; + if(wndMain.CreateEx(NULL, rc, 0, rtl | WS_EX_APPWINDOW | WS_EX_WINDOWEDGE) == NULL) { ATLTRACE(_T("Main window creation failed!\n")); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-05-21 21:42:45
|
Revision: 607 Author: arnetheduck Date: 2006-05-21 14:42:27 -0700 (Sun, 21 May 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=607&view=rev Log Message: ----------- changelog... Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/help/changelog.html Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-05-21 08:53:55 UTC (rev 606) +++ dcplusplus/trunk/changelog.txt 2006-05-21 21:42:27 UTC (rev 607) @@ -1,4 +1,4 @@ --- -- +-- 0.69 2006-05-21 -- * Small linux / old gcc fixes (thanks jens oknelid) * Fixed an issue where client could be crashed from remote * Fixed an issue bad nicks could cause directories to be created in log / file list download folder Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-05-21 08:53:55 UTC (rev 606) +++ dcplusplus/trunk/help/changelog.html 2006-05-21 21:42:27 UTC (rev 607) @@ -13,6 +13,33 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.69 <span style="color: gray;">(2006-05-21)</span></h2> +<ul> + <li>Small linux / old gcc fixes (thanks jens oknelid)</li> + <li>Fixed an issue where client could be crashed from remote</li> + <li>Fixed an issue bad nicks could cause directories to be created in log / file list download folder</li> + <li>Changed autodrop default to 2 for fewer unexpected autodrops (thanks paka)</li> + <li>Saved users file more often to have fewer missing nicks around</li> + <li>CID of user shown if nick is missing (in queue for example)</li> + <li>Added display of CID in a few places</li> + <li>Updated yaSSL to 1.2.2</li> + <li>Fixed ADC hubname display (thanks ullner)</li> + <li>Advanced TTH rollback no longer performed if tree is invalid (thanks garg)</li> + <li>Option not to auto-disconnect favorite users (thanks ullner)</li> + <li>Fixed auto-disconnect delay (thanks uller)</li> + <li>Another fix for opencow</li> + <li>Fixed user command parameters not being remembered</li> + <li>Fixed ADC op commands</li> + <li>[bug 464] Added option for masked password prompt (thanks ullner)</li> + <li>[bug 922] Updated help links (thanks xan)</li> + <li>Fixed op count</li> + <li>[bug 230] Added settings to tray menu</li> + <li>[bug 403] Unfinished file lists deleted since they're never resumed anyway</li> + <li>[bug 639] Separated remove user from queue menu option</li> + <li>[bug 766] Fixed broken app titlebar</li> + <li>Removed support for generating NMDC-style file lists (old clients won't be able to download from you)</li> +</ul> + <h2>0.689 <span style="color: gray;">(2006-04-01)</span></h2> <ul> <li>Fixed displaying of available bytes when user list is off</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-06-03 11:15:04
|
Revision: 609 Author: arnetheduck Date: 2006-06-03 04:12:22 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=609&view=rev Log Message: ----------- Patches & adc fixes Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.vcproj dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcCommand.cpp dcplusplus/trunk/client/AdcCommand.h dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/CID.h dcplusplus/trunk/client/ClientManager.cpp dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/SearchManager.cpp dcplusplus/trunk/client/StringDefs.cpp dcplusplus/trunk/client/StringDefs.h dcplusplus/trunk/client/Util.cpp dcplusplus/trunk/client/Util.h dcplusplus/trunk/help/changelog.html dcplusplus/trunk/help/gen_changelog.py dcplusplus/trunk/windows/ADLSearchFrame.cpp dcplusplus/trunk/windows/ADLSearchFrame.h dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/FavoriteDirsPage.cpp dcplusplus/trunk/windows/FavoriteDirsPage.h dcplusplus/trunk/windows/FavoritesFrm.cpp dcplusplus/trunk/windows/FavoritesFrm.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/MainFrm.cpp dcplusplus/trunk/windows/MainFrm.h dcplusplus/trunk/windows/PrivateFrame.cpp dcplusplus/trunk/windows/PrivateFrame.h dcplusplus/trunk/windows/PropertiesDlg.cpp dcplusplus/trunk/windows/SearchFrm.cpp dcplusplus/trunk/windows/SearchFrm.h dcplusplus/trunk/windows/TransferView.cpp dcplusplus/trunk/windows/TransferView.h dcplusplus/trunk/windows/TypedListViewCtrl.h dcplusplus/trunk/windows/UCPage.cpp dcplusplus/trunk/windows/UCPage.h dcplusplus/trunk/windows/UploadPage.cpp dcplusplus/trunk/windows/UploadPage.h dcplusplus/trunk/windows/UsersFrame.cpp dcplusplus/trunk/windows/UsersFrame.h dcplusplus/trunk/windows/WinUtil.cpp dcplusplus/trunk/windows/resource.h Added Paths: ----------- dcplusplus/trunk/windows/MemDC.h Modified: dcplusplus/trunk/DCPlusPlus.vcproj =================================================================== --- dcplusplus/trunk/DCPlusPlus.vcproj 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/DCPlusPlus.vcproj 2006-06-03 11:12:22 UTC (rev 609) @@ -487,6 +487,9 @@ RelativePath=".\windows\MainFrm.h"> </File> <File + RelativePath=".\windows\memdc.h"> + </File> + <File RelativePath=".\windows\NetworkPage.h"> </File> <File Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/Example.xml 2006-06-03 11:12:22 UTC (rev 609) @@ -226,6 +226,10 @@ <String Name="MenuArrange">Arrange icons</String> <String Name="MenuCascade">Cascade</String> <String Name="MenuChangelog">Change Log</String> + <String Name="MenuCloseAllDirList">Close all file list windows</String> + <String Name="MenuCloseAllOfflinePm">Close all offline PM windows</String> + <String Name="MenuCloseAllPm">Close all PM windows</String> + <String Name="MenuCloseAllSearchframe">Close all search windows</String> <String Name="MenuCloseDisconnected">Close disconnected</String> <String Name="MenuContents">Help &Contents F1</String> <String Name="MenuDiscuss">DC++ discussion forum</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/changelog.txt 2006-06-03 11:12:22 UTC (rev 609) @@ -1,4 +1,18 @@ --- 0.69 2006-05-21 -- +-- 0.691 -- +* Links to bugzilla in html changelog +* [bug 122] Added userlist filter (thanks trem) +* [bug 578] Added search for alternates to transfers menu (thanks trem) +* [bug 861] Fixed auto-prio not being set correctly (thanks trem) +* [bug 878] Added close all ... to window menu (thanks trem) +* [bug 903] Holding shift while minimizing will use opposite tray setting (thanks joakim tosteberg) +* [bug 923] PM history always read (thanks trem) +* [bug 927] Fixed OP detection bug (thanks pothead) +* [bug 929] Fixed list view flicker issues (thanks trem) +* [bug 931] Improved keyboard navigation (thanks trem) +* Fixed bug when sending active ADC search results +* Updated to ADC 0.11 + +-- 0.69 2006-05-21 -- * Small linux / old gcc fixes (thanks jens oknelid) * Fixed an issue where client could be crashed from remote * Fixed an issue bad nicks could cause directories to be created in log / file list download folder @@ -10,7 +24,7 @@ * Fixed ADC hubname display (thanks ullner) * Advanced TTH rollback no longer performed if tree is invalid (thanks garg) * Option not to auto-disconnect favorite users (thanks ullner) -* Fixed auto-disconnect delay (thanks uller) +* Fixed auto-disconnect delay (thanks ullner) * Another fix for opencow * Fixed user command parameters not being remembered * Fixed ADC op commands Modified: dcplusplus/trunk/client/AdcCommand.cpp =================================================================== --- dcplusplus/trunk/client/AdcCommand.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/AdcCommand.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -25,7 +25,7 @@ AdcCommand::AdcCommand(u_int32_t aCmd, char aType /* = TYPE_CLIENT */) : cmdInt(aCmd), from(0), type(aType) { } AdcCommand::AdcCommand(u_int32_t aCmd, const u_int32_t aTarget) : cmdInt(aCmd), from(0), to(aTarget), type(TYPE_DIRECT) { } AdcCommand::AdcCommand(Severity sev, Error err, const string& desc, char aType /* = TYPE_CLIENT */) : cmdInt(CMD_STA), from(0), type(aType) { - addParam(Util::toString(sev) + Util::toString(err)); + addParam(Util::toString(sev * 100 + err)); addParam(desc); } AdcCommand::AdcCommand(const string& aLine, bool nmdc /* = false */) throw(ParseException) : cmdInt(0), type(TYPE_CLIENT) { Modified: dcplusplus/trunk/client/AdcCommand.h =================================================================== --- dcplusplus/trunk/client/AdcCommand.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/AdcCommand.h 2006-06-03 11:12:22 UTC (rev 609) @@ -49,6 +49,7 @@ ERROR_CID_TAKEN = 24, ERROR_COMMAND_ACCESS = 25, ERROR_REGGED_ONLY = 26, + ERROR_INVALID_PID = 27, ERROR_BANNED_GENERIC = 30, ERROR_PERM_BANNED = 31, ERROR_TEMP_BANNED = 32, @@ -56,6 +57,8 @@ ERROR_PROTOCOL_UNSUPPORTED = 41, ERROR_INF_MISSING = 42, ERROR_BAD_STATE = 43, + ERROR_FEATURE_MISSING = 44, + ERROR_BAD_IP = 45, ERROR_TRANSFER_GENERIC = 50, ERROR_FILE_NOT_AVAILABLE = 51, ERROR_FILE_PART_NOT_AVAILABLE = 52, Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -404,8 +404,8 @@ AutoArray<u_int8_t> buf(saltBytes); Encoder::fromBase32(salt.c_str(), buf, saltBytes); TigerHash th; - string cid = getMyIdentity().getUser()->getCID().toBase32(); - th.update(cid.c_str(), cid.length()); + CID cid = getMyIdentity().getUser()->getCID(); + th.update(cid.data(), CID::SIZE); th.update(pwd.data(), pwd.length()); th.update(buf, saltBytes); send(AdcCommand(AdcCommand::CMD_PAS, AdcCommand::TYPE_HUB).addParam(Encoder::toBase32(th.finalize(), TigerHash::HASH_SIZE))); Modified: dcplusplus/trunk/client/CID.h =================================================================== --- dcplusplus/trunk/client/CID.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/CID.h 2006-06-03 11:12:22 UTC (rev 609) @@ -44,7 +44,7 @@ string& toBase32(string& tmp) const { return Encoder::toBase32(cid, sizeof(cid), tmp); } size_t toHash() const { return *reinterpret_cast<const size_t*>(cid); } - const u_int8_t* getData() const { return cid; } + const u_int8_t* data() const { return cid; } bool isZero() const { return find_if(cid, cid+SIZE, bind2nd(not_equal_to<u_int8_t>(), 0)) == (cid+SIZE); } Modified: dcplusplus/trunk/client/ClientManager.cpp =================================================================== --- dcplusplus/trunk/client/ClientManager.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/ClientManager.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -312,12 +312,18 @@ Lock l(cs); OnlineIter i = onlineUsers.find(cid); if(i != onlineUsers.end()) { - OnlineUser* u = i->second; - if(cmd.getType() == AdcCommand::TYPE_UDP && !u->getIdentity().isUdpActive()) { + OnlineUser& u = *i->second; + if(cmd.getType() == AdcCommand::TYPE_UDP && !u.getIdentity().isUdpActive()) { cmd.setType(AdcCommand::TYPE_DIRECT); + cmd.setTo(u.getIdentity().getSID()); + u.getClient().send(cmd); + } else { + try { + s.writeTo(u.getIdentity().getIp(), static_cast<short>(Util::toInt(u.getIdentity().getUdpPort())), cmd.toString(getMe()->getCID())); + } catch(const SocketException&) { + dcdebug("Socket exception sending ADC UDP command\n"); + } } - cmd.setTo(u->getIdentity().getSID()); - u->getClient().send(cmd); } } @@ -509,7 +515,7 @@ CID ClientManager::getMyCID() { TigerHash tiger; - tiger.update(getMyPID().getData(), CID::SIZE); + tiger.update(getMyPID().data(), CID::SIZE); return CID(tiger.finalize()); } Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -484,7 +484,7 @@ QueueItem* q = fileQueue.find(target); if(q == NULL) { - q = fileQueue.add(target, aSize, aFlags, QueueItem::NORMAL, Util::emptyString, 0, GET_TIME(), root); + q = fileQueue.add(target, aSize, aFlags, QueueItem::DEFAULT, Util::emptyString, 0, GET_TIME(), root); fire(QueueManagerListener::Added(), q); } else { if(q->getSize() != aSize) { Modified: dcplusplus/trunk/client/SearchManager.cpp =================================================================== --- dcplusplus/trunk/client/SearchManager.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/SearchManager.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -344,7 +344,6 @@ for(SearchResult::Iter i = results.begin(); i != results.end(); ++i) { AdcCommand cmd = (*i)->toRES(AdcCommand::TYPE_UDP); - cmd.setTo(adc.getFrom()); if(!token.empty()) cmd.addParam("TO", token); ClientManager::getInstance()->send(cmd, from); Modified: dcplusplus/trunk/client/StringDefs.cpp =================================================================== --- dcplusplus/trunk/client/StringDefs.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/StringDefs.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -227,6 +227,10 @@ "Arrange icons", "Cascade", "Change Log", +"Close all file list windows", +"Close all offline PM windows", +"Close all PM windows", +"Close all search windows", "Close disconnected", "Help &Contents\tF1", "DC++ discussion forum", @@ -832,6 +836,10 @@ "MenuArrange", "MenuCascade", "MenuChangelog", +"MenuCloseAllDirList", +"MenuCloseAllOfflinePm", +"MenuCloseAllPm", +"MenuCloseAllSearchframe", "MenuCloseDisconnected", "MenuContents", "MenuDiscuss", Modified: dcplusplus/trunk/client/StringDefs.h =================================================================== --- dcplusplus/trunk/client/StringDefs.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/StringDefs.h 2006-06-03 11:12:22 UTC (rev 609) @@ -230,6 +230,10 @@ MENU_ARRANGE, // "Arrange icons" MENU_CASCADE, // "Cascade" MENU_CHANGELOG, // "Change Log" + MENU_CLOSE_ALL_DIR_LIST, // "Close all file list windows" + MENU_CLOSE_ALL_OFFLINE_PM, // "Close all offline PM windows" + MENU_CLOSE_ALL_PM, // "Close all PM windows" + MENU_CLOSE_ALL_SEARCHFRAME, // "Close all search windows" MENU_CLOSE_DISCONNECTED, // "Close disconnected" MENU_CONTENTS, // "Help &Contents\tF1" MENU_DISCUSS, // "DC++ discussion forum" Modified: dcplusplus/trunk/client/Util.cpp =================================================================== --- dcplusplus/trunk/client/Util.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/Util.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -571,6 +571,38 @@ return (string::size_type)string::npos; } +wstring::size_type Util::findSubString(const wstring& aString, const wstring& aSubString, wstring::size_type pos) throw() { + if(aString.length() < pos) + return static_cast<wstring::size_type>(wstring::npos); + + if(aString.length() - pos < aSubString.length()) + return static_cast<wstring::size_type>(wstring::npos); + + if(aSubString.empty()) + return 0; + + wstring::size_type j = 0; + wstring::size_type end = aString.length() - aSubString.length() + 1; + + for(; pos < end; ++pos) { + if(Text::toLower(aString[pos]) == Text::toLower(aSubString[j])) { + wstring::size_type tmp = pos+1; + bool found = true; + for(++j; j < aSubString.length(); ++j, ++tmp) { + if(Text::toLower(aString[tmp]) != Text::toLower(aSubString[j])) { + j = 0; + found = false; + break; + } + } + + if(found) + return pos; + } + } + return static_cast<wstring::size_type>(wstring::npos); +} + int Util::stricmp(const char* a, const char* b) { while(*a) { wchar_t ca = 0, cb = 0; Modified: dcplusplus/trunk/client/Util.h =================================================================== --- dcplusplus/trunk/client/Util.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/client/Util.h 2006-06-03 11:12:22 UTC (rev 609) @@ -466,6 +466,7 @@ * @return First position found or string::npos */ static string::size_type findSubString(const string& aString, const string& aSubString, string::size_type start = 0) throw(); + static wstring::size_type findSubString(const wstring& aString, const wstring& aSubString, wstring::size_type start = 0) throw(); /* Utf-8 versions of strnicmp and stricmp, unicode char code order (!) */ static int stricmp(const char* a, const char* b); Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/help/changelog.html 2006-06-03 11:12:22 UTC (rev 609) @@ -26,17 +26,17 @@ <li>Fixed ADC hubname display (thanks ullner)</li> <li>Advanced TTH rollback no longer performed if tree is invalid (thanks garg)</li> <li>Option not to auto-disconnect favorite users (thanks ullner)</li> - <li>Fixed auto-disconnect delay (thanks uller)</li> + <li>Fixed auto-disconnect delay (thanks ullner)</li> <li>Another fix for opencow</li> <li>Fixed user command parameters not being remembered</li> <li>Fixed ADC op commands</li> - <li>[bug 464] Added option for masked password prompt (thanks ullner)</li> - <li>[bug 922] Updated help links (thanks xan)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=464">[bug 464]</a> Added option for masked password prompt (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=922">[bug 922]</a> Updated help links (thanks xan)</li> <li>Fixed op count</li> - <li>[bug 230] Added settings to tray menu</li> - <li>[bug 403] Unfinished file lists deleted since they're never resumed anyway</li> - <li>[bug 639] Separated remove user from queue menu option</li> - <li>[bug 766] Fixed broken app titlebar</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=230">[bug 230]</a> Added settings to tray menu</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=403">[bug 403]</a> Unfinished file lists deleted since they're never resumed anyway</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=639">[bug 639]</a> Separated remove user from queue menu option</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=766">[bug 766]</a> Fixed broken app titlebar</li> <li>Removed support for generating NMDC-style file lists (old clients won't be able to download from you)</li> </ul> @@ -45,18 +45,18 @@ <li>Fixed displaying of available bytes when user list is off</li> <li>Fixed a potential crash when not showing user list</li> <li>Fixed 100% CPU bug on upload</li> - <li>[bug 853] Fixed missing function in opencow</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=853">[bug 853]</a> Fixed missing function in opencow</li> </ul> <h2>0.688 <span style="color: gray;">(2006-03-18)</span></h2> <ul> <li>Fixed public hubs sorting (thanks pothead)</li> <li>Fixed a ZPipe issue (thanks jove)</li> - <li>[bug 858] Fixed a 100% cpu / crash bug</li> - <li>[bug 872] Fixed a pm issue hopefully</li> - <li>[bug 812] Fixed pm's being sent to bots</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=858">[bug 858]</a> Fixed a 100% cpu / crash bug</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=872">[bug 872]</a> Fixed a pm issue hopefully</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=812">[bug 812]</a> Fixed pm's being sent to bots</li> <li>Files with invalid crc-32, as per their sfv file, are no longer shared</li> - <li>[bug 873] Added connect to hub option (thanks joakim tosteberg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=873">[bug 873]</a> Added connect to hub option (thanks joakim tosteberg)</li> <li>Fixed an issue with linux file reading (thanks bart vullings and steven)</li> <li>Added back/forward mouse/keyboard navigation to directory listing frame</li> </ul> @@ -91,15 +91,15 @@ <li>Fixed "browse list" being available for NMDC users</li> <li>[ADC] Removed obsolete CI field</li> <li>Fixed missing upload progress</li> - <li>[bug 89] Readded dynamic compression disabling</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=89">[bug 89]</a> Readded dynamic compression disabling</li> <li>Added filelist download speed to filelist browser status bar</li> <li>Added advanced hublist filter (thanks trem)</li> - <li>[bug 579] Fixed 0-byte files not being created if directory doesn't exist</li> - <li>[bug 804] Cleaned up project files (thanks pothead)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=579">[bug 579]</a> Fixed 0-byte files not being created if directory doesn't exist</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=804">[bug 804]</a> Cleaned up project files (thanks pothead)</li> <li>Socket buffer size = 0 now means use system default</li> - <li>[bug 789] Fixed wrong nick being copied (thanks ullner)</li> - <li>[bug 794] [ADC] Fixed automatic reconnect (thanks ullner)</li> - <li>[bug 806] Fixed description for favorite hubs (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=789">[bug 789]</a> Fixed wrong nick being copied (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=794">[bug 794]</a> [ADC] Fixed automatic reconnect (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=806">[bug 806]</a> Fixed description for favorite hubs (thanks ullner)</li> <li>Updated to latest ADC specs, this will break 0.68/0.681/0.6811 queue sources and fav users (for NMDC as well)</li> <li>Fixed a bufferedsocket crash</li> <li>[ADC] Fixed quitting user processing (thanks ullner)</li> @@ -110,8 +110,8 @@ <li>Fixed an issue with nick names disappearing from hub</li> <li>Added customizable maximum user count when autosearching</li> <li>Changed to open source version unicows for win9x users, perhaps this one will work better for you (see it as a last attempt; if it doesn't work, w9x support will be phased out completely unless someone else solves the win9x issues)</li> - <li>[bug 774] Fixed invalid description being sent if hub modifies it</li> - <li>[bug 818] Fixed default exit mnemonic</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=774">[bug 774]</a> Fixed invalid description being sent if hub modifies it</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=818">[bug 818]</a> Fixed default exit mnemonic</li> <li>Fixed some more crashes (thanks bigmuscle)</li> <li>Fixed some shutdown issues</li> <li>Updated country database</li> @@ -129,12 +129,12 @@ <li>Minor user command fix (thanks garg)</li> <li>Removed some duplicate code (thanks trem)</li> <li>Ctrl-a to select all items in a list (thanks garg)</li> - <li>[bug 484] Added a check for multiple refreshes running at the same time (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=484">[bug 484]</a> Added a check for multiple refreshes running at the same time (thanks trem)</li> <li>Fixed a few crashes here and there</li> <li>Fixed no-slots message not being sent out always</li> <li>Fixed yassl build locations (thanks pothead)</li> <li>Added ip resolve cache when searching (thanks trem)</li> - <li>[bug 413] Failed file moves are now reported to the system log</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=413">[bug 413]</a> Failed file moves are now reported to the system log</li> </ul> <h2>0.68 <span style="color: gray;">(2006-01-08)</span></h2> @@ -143,7 +143,7 @@ <li>Removed saving of directories scheduled for download, since the individual files should appear in the queue fast enough that this will rarely be used (since file lists are free and downloaded almost instantly)</li> <li>Fixed international timestamps (thanks ullner)</li> <li>Fixed targetdrive docs (thanks ullner)</li> - <li>[bug 485] Fixed transfer list view flicker on WinXP</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=485">[bug 485]</a> Fixed transfer list view flicker on WinXP</li> <li>New connection settings, please check settings page</li> <li>Connection type strings changed</li> <li>No longer falls back to passive mode on failed UPnP</li> @@ -151,35 +151,35 @@ <li>Removed some old favorite file format compatibility code</li> <li>Added country to search frame (thanks paka)</li> <li>Strftime fix (thanks garg)</li> - <li>[bug 521] Help instead of readme shown on first startup (thanks paka)</li> - <li>[bug 553] Minimize to tray and confirm appexit default to true (thanks paka)</li> - <li>[bug 452] Fixed example.xml language file generation (thanks tpo)</li> - <li>[bug 556] Fixed last searches purge (thanks sulan)</li> - <li>[bug 73] Added option to disconnect slow sources (thanks paka)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=521">[bug 521]</a> Help instead of readme shown on first startup (thanks paka)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=553">[bug 553]</a> Minimize to tray and confirm appexit default to true (thanks paka)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=452">[bug 452]</a> Fixed example.xml language file generation (thanks tpo)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=556">[bug 556]</a> Fixed last searches purge (thanks sulan)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=73">[bug 73]</a> Added option to disconnect slow sources (thanks paka)</li> <li>ADC hub counts updated correctly (thanks ullner)</li> - <li>[bug 325] Added error message when adding dupe fav hub (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=325">[bug 325]</a> Added error message when adding dupe fav hub (thanks ullner)</li> <li>Updated bzip2 to 1.0.3 (thanks garg)</li> <li>Some small *nix fixes (thanks poison)</li> <li>Source path no longer saved for TTH enabled clients (saves memory and queue file space)</li> - <li>[bug 335] Search window settings saved automatically (thanks pothead)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=335">[bug 335]</a> Search window settings saved automatically (thanks pothead)</li> <li>Open folder selects file in explorer (thanks pothead)</li> <li>Local echo in pm window formatted as the other side should see it (thanks paka)</li> <li>Fixed debug assertion (thanks tpo)</li> <li>Dirty tabs settings improved (thanks ullner)</li> <li>ZLib upgraded to 1.2.3, possibly fixing security issues (thanks garg)</li> <li>Slot grants now last one connection instead of 10 minutes</li> - <li>[bug 632] Subtotals shown when selecting users in hub frame (thanks cologic)</li> - <li>[bug 625] /u chat command opens url (thanks pur)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=632">[bug 632]</a> Subtotals shown when selecting users in hub frame (thanks cologic)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=625">[bug 625]</a> /u chat command opens url (thanks pur)</li> <li>[NMDC] The first word of hub name is taken as short name for displaying purposes when space is limited</li> - <li>[bug 629] Waiting users frame added (thanks cologic)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=629">[bug 629]</a> Waiting users frame added (thanks cologic)</li> <li>Removed old versions check (thanks cologic)</li> - <li>[bug 635] Added option to limit maximum file list size to open (thanks paka)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=635">[bug 635]</a> Added option to limit maximum file list size to open (thanks paka)</li> <li>Filelist transfer logging default to off (thanks paka)</li> <li>Added some checks when creating fav hubs (thanks tpo)</li> <li>More settings screen updates (thanks ullner)</li> <li>Fixed linux file moving (thanks naga)</li> - <li>[bug 260] Added option to only download files with TTH (thanks ullner)</li> - <li>[bug 708] Fixed registry creation functions used (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=260">[bug 260]</a> Added option to only download files with TTH (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=708">[bug 708]</a> Fixed registry creation functions used (thanks ullner)</li> <li>Updated WTL</li> <li>Rewrote socket code to remove some old hacks and add some new (major change)</li> <li>Now using standard windows error messages for socket errors</li> @@ -197,12 +197,12 @@ <li>Improved hashing error reporting</li> <li>Fixed hash database rebuild</li> <li>Added /removefav command to remove a favorite hub (thanks ullner)</li> - <li>[bug 717] Fixed search combo box (thanks pothead)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=717">[bug 717]</a> Fixed search combo box (thanks pothead)</li> <li>Added option to change auto-refresh interval (thanks ullner)</li> - <li>[bug 740] Removed tab completion option (thanks ullner)</li> - <li>[bug 743] Added registry key creation failure notification (thanks ullner)</li> - <li>[bug 717] Fixed dropdown sizes (thanks pothead)</li> - <li>[bug 760] Fixed list subtraction issue (thanks cologic)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=740">[bug 740]</a> Removed tab completion option (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=743">[bug 743]</a> Added registry key creation failure notification (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=717">[bug 717]</a> Fixed dropdown sizes (thanks pothead)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=760">[bug 760]</a> Fixed list subtraction issue (thanks cologic)</li> <li>Added some right-to-left support, but it probably needs more work</li> <li>[NMDC] Minislots are no longer given to old DC++ clients (<0.304)</li> <li>[ADC] Directory size returned with search results</li> @@ -219,7 +219,7 @@ <li>Fixed context menu open for multi-screen setups (thanks trem)</li> <li>Changed country database to the original format so that users can update by themselves (thanks paka)</li> <li>Fixed some registry issues (thanks trem)</li> - <li>[bug 443] Fixed localised number encodings (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=443">[bug 443]</a> Fixed localised number encodings (thanks trem)</li> <li>Updated sorting to use a more windows-like order (thanks trem)</li> <li>Fixed an issue with restore all (thanks krzysztof tyszecki)</li> <li>Added list view tooltips</li> @@ -245,10 +245,10 @@ <h2>0.671 <span style="color: gray;">(2005-03-19)</span></h2> <ul> <li>Added possibility to set minislot size (thanks ullner)</li> - <li>[bug 22] Added possibility for multiline away messages and user commands (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=22">[bug 22]</a> Added possibility for multiline away messages and user commands (thanks ullner)</li> <li>Added file type to queue frame (thanks ullner)</li> <li>Changed stats frame to use standard colors (thanks yoji)</li> - <li>[bug 439] Fixed purge button (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=439">[bug 439]</a> Fixed purge button (thanks ullner)</li> <li>Fixed search frame only tth issue (thanks naga)</li> <li>Updated to ADC 0.9</li> <li>Fixed a crash bug (thanks trem)</li> @@ -264,8 +264,8 @@ <li>Basic ADC transfers now work</li> <li>Added option to specify bind address for sockets (thanks sed)</li> <li>Made the connection flood trigger slighly less sensitive</li> - <li>[bug 58] Fixed strange user list behaviour</li> - <li>[bug 83] Consolidated auto-open window options</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=58">[bug 58]</a> Fixed strange user list behaviour</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=83">[bug 83]</a> Consolidated auto-open window options</li> <li>Fixed some context menu stuff</li> </ul> @@ -274,30 +274,30 @@ <li>Fixed an issue with international formats of float numbers (also fixes UDP port setting)</li> <li>Fixed a minor crash log output address issue</li> <li>Split off color and sound to a new page (thanks ullner)</li> - <li>[bug 359] Fixed an issue with negative search terms (thanks naga)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=359">[bug 359]</a> Fixed an issue with negative search terms (thanks naga)</li> <li>Added option to filter TTH results in search spy (thanks joakim tosteberg)</li> - <li>[bug 184] Updated log functionality to allow users to customize log filenames (thanks naga)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=184">[bug 184]</a> Updated log functionality to allow users to customize log filenames (thanks naga)</li> <li>Fixes to log edit function (thanks naga)</li> <li>Added possibility to filter all searches without tth (thanks naga)</li> <li>More preferences splitting (thanks ullner)</li> <li>Small socket fix (thanks tremor)</li> <li>Search tab goes bold if set to (thanks naga)</li> <li>Hopefully fixed an UPnP crash</li> - <li>[bug 302] User commands in file lists (thanks joakim tosteberg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=302">[bug 302]</a> User commands in file lists (thanks joakim tosteberg)</li> <li>ADC url's clickable (thanks naga)</li> <li>[Bug 117] Improved search timer to avoid spamming hub (thanks naga)</li> <li>Redid some of the hash storage code, should be slighly more efficient</li> - <li>[bug 94] Share is cached for faster startup</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=94">[bug 94]</a> Share is cached for faster startup</li> <li>Temporary targetnames are now filled in when download starts, not when item is added to queue, which makes temp target dir changes happen for current queue items as well, plus we get a huge memory save on huge queues.</li> - <li>[bug 363] Added "Remove All Sources" to queue (thanks izzzo & garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=363">[bug 363]</a> Added "Remove All Sources" to queue (thanks izzzo & garg)</li> <li>Queue menu items greyed out when there are no items (thanks izzzo)</li> <li>Fixed a crash with certain empty lists (thanks garg)</li> <li>Added "restore all" to undo "minimize all" (thanks guitarm)</li> <li>Added optional pm history (thanks trem and ullner)</li> <li>Better log file managment (thanks trem)</li> - <li>[bug 412] Fixed a queue count issue on removal (thanks ullner)</li> - <li>[bug 9] Fixed a queue move issue (thanks paka)</li> - <li>[bug 20] Fixed upload auto-slot granting (thanks naga)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=412">[bug 412]</a> Fixed a queue count issue on removal (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=9">[bug 9]</a> Fixed a queue move issue (thanks paka)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=20">[bug 20]</a> Fixed upload auto-slot granting (thanks naga)</li> <li>Redid adl search to accomodate for partial list browsing (thanks garg)</li> <li>Added initial ADC file transfers support</li> <li>ADC hub connectivity improved</li> @@ -323,10 +323,10 @@ <li>Added exact file size to directory listings (thanks paka)</li> <li>Remove confirm fix (thanks trem)</li> <li>Added option for the new tab select behaviour (thanks trem)</li> - <li>[bug 116] Added possibility to download to temp folder on the same drive as target (thanks sed)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=116">[bug 116]</a> Added possibility to download to temp folder on the same drive as target (thanks sed)</li> <li>Fixed user command string for file list context (thanks sed)</li> - <li>[bug 290] Added more correct escaping of search strings (thanks sed)</li> - <li>[bug 432] Fixed download directory for adlsearch matches (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=290">[bug 290]</a> Added more correct escaping of search strings (thanks sed)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=432">[bug 432]</a> Fixed download directory for adlsearch matches (thanks ullner)</li> <li>Some UPnP fixes (thanks nils maier)</li> <li>ADL Search byte prefix fixes, might screw up your adl search settings on first load (thanks ullner)</li> <li>Linux download path fix (thanks jens oknelid)</li> @@ -337,7 +337,7 @@ <h2>0.668 <span style="color: gray;">(2004-11-30)</span></h2> <ul> - <li>[bug 311] Fixed crash on open own filelist (thanks sulan)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=311">[bug 311]</a> Fixed crash on open own filelist (thanks sulan)</li> <li>Added option to make /join open a new window (thanks ullner)</li> <li>Added mailto: to link-clicking (thanks ullner)</li> <li>Fixed stack overflow with excessive xml nesting (thanks farcry)</li> @@ -347,9 +347,9 @@ <li>PgUp/PgDn now scroll the chat window (thanks jonathan stone)</li> <li>Small fix with line history (thanks jonathan stone)</li> <li>Added option to use separate TCP and UDP ports</li> - <li>[bug 303] Fixed a raw command guessing bug (thanks garg)</li> - <li>[bug 345] Fixed an xml listing parsing bug</li> - <li>[bug 309] Hopefully fixed nt4 startup</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=303">[bug 303]</a> Fixed a raw command guessing bug (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=345">[bug 345]</a> Fixed an xml listing parsing bug</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=309">[bug 309]</a> Hopefully fixed nt4 startup</li> <li>Hopefully fixed an issue with downloading international search results from old clients</li> </ul> @@ -358,9 +358,9 @@ <li>Improved multiple hublist support (thanks garg)</li> <li>Fixed some favdirs issues (thanks naga)</li> <li>Fixed a status logging issue (thanks naga)</li> - <li>[bug 289] Fixed annoying login issue</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=289">[bug 289]</a> Fixed annoying login issue</li> <li>Added possibility to rename shares (thanks naga and tremor)</li> - <li>[bug 106] Fixed show joins for fav users (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=106">[bug 106]</a> Fixed show joins for fav users (thanks ullner)</li> <li>Fixed some unnecessary connects when download slots are full</li> <li>Fixed magnet registration issue (thanks garg)</li> <li>Some code documentation work (thanks jonathan jansson)</li> @@ -379,63 +379,63 @@ <h2>0.666 <span style="color: gray;">(2004-11-03)</span></h2> <ul> - <li>[bug 173] Fixed copy nick to clipboard (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=173">[bug 173]</a> Fixed copy nick to clipboard (thanks trem)</li> <li>Removed some old code (thanks garg)</li> <li>Added tth to log codes (thanks garg)</li> <li>Added # of locally filtered results to search frame (thanks garg)</li> <li>Fixed a crash in the upnp code</li> <li>Fixed wide formatting of time (thanks garg)</li> - <li>[bug 166] Added local filtering of searches with "-" in front of the search term (thanks cologic)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=166">[bug 166]</a> Added local filtering of searches with "-" in front of the search term (thanks cologic)</li> <li>Fixed a missing hubframe stats bug (thanks trem)</li> - <li>[bug 87] TTH's are now correctly searched for in search spy (thanks trem)</li> - <li>[bug 256] Fixed an issue with utf8 user commands (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=87">[bug 87]</a> TTH's are now correctly searched for in search spy (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=256">[bug 256]</a> Fixed an issue with utf8 user commands (thanks trem)</li> <li>Moved to a less intrusive build procedure where stlport and wtl are local to the DC++ build (see compile.txt)</li> <li>Added /log to show log for current hub / user (thanks garg)</li> <li>More internationalization (thanks garg)</li> <li>Updated some template code (thanks farcry)</li> <li>Extended log command (thanks ullner)</li> - <li>[bug 212] Fixed issue with utf-8 nicks during login to some hubs (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=212">[bug 212]</a> Fixed issue with utf-8 nicks during login to some hubs (thanks garg)</li> <li>Fixed issue with utf-8 time formatting for certain languages in certain locales</li> <li>Removed search optimisation obsoleted by tth's and bloom filters (those of you with a large number of files in your share, post on the forum if you notice any big increase in CPU usage)</li> - <li>[bug 69] Added option not to download files already in share (by TTH) (thanks TPO)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=69">[bug 69]</a> Added option not to download files already in share (by TTH) (thanks TPO)</li> <li>Help file work (garg, ullner)</li> <li>Added petabytes (PiB) (thanks garg)</li> <li>Clicking on active tab will deactivate it (thanks garg)</li> - <li>[bug 227] Fixed an issue with loading invalid virtual names when upgrading (thanks garg)</li> - <li>[bug 256] Fixed another issue with user commands (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=227">[bug 227]</a> Fixed an issue with loading invalid virtual names when upgrading (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=256">[bug 256]</a> Fixed another issue with user commands (thanks garg)</li> <li>Updated to WTL 7.5.4291</li> - <li>[bug 183] Hopefully fixed a few issues with w9x and Unicode</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=183">[bug 183]</a> Hopefully fixed a few issues with w9x and Unicode</li> <li>Fixed common control initialization</li> <li>Unix makefile now generates a shared lib (thanks jeremy huddleston)</li> <li>Slight memory save for hash database</li> - <li>[bug 130] Added favorite hub removal confirmation option (thanks ullner)</li> - <li>[bug 5] Fixed broken redirect (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=130">[bug 130]</a> Added favorite hub removal confirmation option (thanks ullner)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=5">[bug 5]</a> Fixed broken redirect (thanks garg)</li> <li>Added spy frame column saving (thanks garg)</li> <li>ADL Search autoqueue saved now (thanks garg)</li> <li>Window minimization issue fix (thanks garg)</li> - <li>[bug 129] Fixed some issues with downloading >4GiB files</li> - <li>[bug 15] ADL Search goto directory fixed (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=129">[bug 129]</a> Fixed some issues with downloading >4GiB files</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=15">[bug 15]</a> ADL Search goto directory fixed (thanks garg)</li> <li>Some fixes for compiling on osx (thanks jonathan jansson)</li> <li>Removed Makedefs in favour of a python script</li> <li>FastAlloc disabled in debug builds</li> - <li>[bug 266] Fixed a crash with offline users and user commands (thanks naga)</li> - <li>[bug 165] Fixed a case insensitivity issue (thanks farcry)</li> - <li>[bug 18] Added favorite download directories (thanks naga)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=266">[bug 266]</a> Fixed a crash with offline users and user commands (thanks naga)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=165">[bug 165]</a> Fixed a case insensitivity issue (thanks farcry)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=18">[bug 18]</a> Added favorite download directories (thanks naga)</li> <li>Fixed MyINFO spam when hashing</li> </ul> <h2>0.4034 <span style="color: gray;">(2004-10-03)</span></h2> <ul> <li>Help file additions (thanks naga & ullner)</li> - <li>[bug 170] Fixed a few issues with files not being hashed correctly (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=170">[bug 170]</a> Fixed a few issues with files not being hashed correctly (thanks garg)</li> <li>More ADC fixes (thanks sed)</li> <li>Fixed some ADLSearch stuff (thanks garg)</li> <li>Added item count to finished frames (thanks garg)</li> <li>Fixed user commands encoding (thanks garg)</li> <li>Added last search time to search spy (thanks ullner)</li> - <li>[bug 3] Fixed queue size growing on queue item move</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=3">[bug 3]</a> Fixed queue size growing on queue item move</li> <li>Fixed missing file list on 0 byte share</li> - <li>[bug 185] Fixed missing search results (thanks garg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=185">[bug 185]</a> Fixed missing search results (thanks garg)</li> </ul> <h2>0.4033 <span style="color: gray;">(2004-09-27)</span></h2> @@ -452,7 +452,7 @@ <li>Fixed directory sorting in the file listings (thanks trem)</li> <li>Files that can't be moved to the target drive from the temp folder are now renamed to their real name</li> <li>Text with unix and mac line end encodings should now be correctly displayed</li> - <li>[bug 35] TTH Values are used for right click download menus when available</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=35">[bug 35]</a> TTH Values are used for right click download menus when available</li> <li>Upgraded to WTL 7.5.4196</li> <li>Updated license to allow others to release legal binaries compiled against WTL</li> <li>Moved the core structures to UTF-8 to allow correct internationalisation (major change)</li> @@ -462,7 +462,7 @@ <li>Removed autosearch string, it's not used any more</li> <li>Fixed a tth hash speed bug (hashing should be much faster now)</li> <li>File listings are now generated on the fly when someone needs them</li> - <li>[bug 127] Added UPnP support (thanks mark gillespie)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=127">[bug 127]</a> Added UPnP support (thanks mark gillespie)</li> <li>Ctrl-L now opens file lists (thanks garg)</li> <li>Various ADC patches (thanks sedulus)</li> <li>Slightly changed temporary download name</li> @@ -473,7 +473,7 @@ <li>Fixed a bug with autosearch repeating the same search needlessly (this should result in fewer autosearches, good for the hubs)</li> <li>Files scheduled for viewing are always set to highest prio</li> <li>Added rudimentary automake and autoconf support for the client part, perhaps this will encourage someone to finish a nice linux port</li> - <li>[bug 162] Fixed dupe usercommands on reconnect (thanks sed)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=162">[bug 162]</a> Fixed dupe usercommands on reconnect (thanks sed)</li> <li>Links now clickable in PM's and notepad as well (thanks naga)</li> <li>Files are no longer hashed if the shared directory is removed while hashing</li> <li>Added hash progress dialog, hashing is run at a higher priority when dialog is shown</li> @@ -481,7 +481,7 @@ <li>Better strategy for removing old filelists on exit (thanks garg)</li> <li>Added Geo-IP license and fixes (thanks garg)</li> <li>Added Help file - make sure you read it (thanks garg)</li> - <li>[bug 169] Fixed a memory leak with rollback buffers under certain conditions</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=169">[bug 169]</a> Fixed a memory leak with rollback buffers under certain conditions</li> <li>ADC INF updates only send the necessary info (thanks sed)</li> </ul> Modified: dcplusplus/trunk/help/gen_changelog.py =================================================================== --- dcplusplus/trunk/help/gen_changelog.py 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/help/gen_changelog.py 2006-06-03 11:12:22 UTC (rev 609) @@ -1,21 +1,14 @@ #!/usr/bin/env python - import os, re, cgi - - filetext = "../changelog.txt" - filehtml = "changelog.html" #os.rename(filehtml,"%s.old" % filehtml) fp_txt = open(filetext,'r') - fp_html = open(filehtml,'w') - - start_head = """<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> <html> <head> @@ -33,148 +26,85 @@ """ - - end_html = "</body>\n</html>" - - start_change = " <li>%(change)s" - +bug_text = " <li><a href=\"http://dcpp.net/bugzilla/show_bug.cgi?id=%(bug_id)s\">[bug %(bug_id)s]</a> %(change)s" change = " %(change)s" - end_change = "</li>\n" - - start_version = "<h2>%(version)s <span style=\"color: gray;\">(%(date)s)</span></h2>\n<ul>\n" - end_version = "</ul>\n\n" - - start_warning_end = " <li><span style=\"color: red;\">%(change)s</span></li>\n" - - new_version_pattern = re.compile("^.*?-- (?P<version>.*?) (?P<date>.*?) --") - -new_change = re.compile("^\* (?P<change>.*?)$") - +new_change = re.compile(r"^\* (?P<change>.*?)$") +bug_change = re.compile(r"^\* \[bug (?P<bug_id>\d+?)\] (?P<change>.*?)$") continue_change = re.compile("^\w*?(?P<change>.*?)$") - warning_change = re.compile("^(?P<change>[^ ].*?)$") - fp_html.write(start_head) - - open_change_state = False - close_version = False - start = False - - for line in fp_txt: - line = cgi.escape(line.strip()) - if not line: - if open_change_state: - fp_html.write(end_change) - open_change_state = False - continue - - mObj = new_version_pattern.match(line) - if mObj and mObj.groupdict()["date"] : - if close_version: - if open_change_state: - fp_html.write(end_change) - fp_html.write(end_version) - start = True - close_version = True - open_change_state = False - open_warning_state = False - fp_html.write(start_version % mObj.groupdict()) - continue - - if not start: - continue - + mObj = bug_change.match(line) + if mObj: + if open_change_state: + fp_html.write(end_change) + fp_html.write(bug_text % mObj.groupdict()) + open_change_state = True + continue mObj = new_change.match(line) - if mObj: # A new change is found: Close Open Warning or Changes. - if open_change_state: - fp_html.write(end_change) - fp_html.write(start_change % mObj.groupdict()) - open_change_state = True - continue - - mObj = continue_change.match(line) - if mObj and open_change_state: #A continutaion of an change (multiline change). - fp_html.write(change % mObj.groupdict()) - continue - - mObj = warning_change.match(line) - if mObj: - if open_change_state: - fp_html.write(end_change_state) - fp_html.write(start_warning_end % mObj.groupdict()) - continue - - if open_change_state: - fp_html.write(end_change) - if close_version: - fp_html.write(end_version) - fp_html.write(end_html) - fp_html.close() - -fp_txt.close() \ No newline at end of file +fp_txt.close() Modified: dcplusplus/trunk/windows/ADLSearchFrame.cpp =================================================================== --- dcplusplus/trunk/windows/ADLSearchFrame.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/ADLSearchFrame.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -63,7 +63,6 @@ ctrlList.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE, IDC_ADLLIST); ctrlList.SetExtendedListViewStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT); - listContainer.SubclassWindow(ctrlList.m_hWnd); // Set background color ctrlList.SetBkColor(WinUtil::bgColor); @@ -197,18 +196,19 @@ } // Keyboard shortcuts -LRESULT ADLSearchFrame::onChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) +LRESULT ADLSearchFrame::onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled) { - switch(wParam) + NMLVKEYDOWN* kd = (NMLVKEYDOWN*) pnmh; + switch(kd->wVKey) { case VK_INSERT: - onAdd(0, 0, 0, bHandled); + PostMessage(WM_COMMAND, IDC_ADD, 0); break; case VK_DELETE: - onRemove(0, 0, 0, bHandled); + PostMessage(WM_COMMAND, IDC_REMOVE, 0); break; case VK_RETURN: - onEdit(0, 0, 0, bHandled); + PostMessage(WM_COMMAND, IDC_EDIT, 0); break; default: bHandled = FALSE; @@ -466,18 +466,15 @@ } // Double-click on list control -LRESULT ADLSearchFrame::onDoubleClickList(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled) +LRESULT ADLSearchFrame::onDoubleClickList(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { NMITEMACTIVATE* item = (NMITEMACTIVATE*)pnmh; - // Hit-test - LVHITTESTINFO info; - info.pt = item->ptAction; - int iItem = ctrlList.SubItemHitTest(&info); - if(iItem >= 0) - { + if(item->iItem >= 0) { // Treat as onEdit command - onEdit(0, 0, 0, bHandled); + PostMessage(WM_COMMAND, IDC_EDIT, 0); + } else if(item->iItem == -1) { + PostMessage(WM_COMMAND, IDC_ADD, 0); } return 0; Modified: dcplusplus/trunk/windows/ADLSearchFrame.h =================================================================== --- dcplusplus/trunk/windows/ADLSearchFrame.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/ADLSearchFrame.h 2006-06-03 11:12:22 UTC (rev 609) @@ -34,8 +34,6 @@ #include "../client/ADLSearch.h" -#define ADLLIST_MESSAGE_MAP 6 - /////////////////////////////////////////////////////////////////////////////// // // Class that represent an ADL search manager interface @@ -49,7 +47,7 @@ typedef MDITabChildWindowImpl<ADLSearchFrame> baseClass; // Constructor/destructor - ADLSearchFrame() : listContainer(WC_LISTBOX, this, ADLLIST_MESSAGE_MAP) {} + ADLSearchFrame() {} virtual ~ADLSearchFrame() { } // Frame window declaration @@ -71,9 +69,8 @@ COMMAND_ID_HANDLER(IDC_MOVE_DOWN, onMoveDown) NOTIFY_HANDLER(IDC_ADLLIST, NM_DBLCLK, onDoubleClickList) NOTIFY_HANDLER(IDC_ADLLIST, LVN_ITEMCHANGED, onItemChanged) + NOTIFY_HANDLER(IDC_ADLLIST, LVN_KEYDOWN, onKeyDown) CHAIN_MSG_MAP(baseClass) - ALT_MSG_MAP(ADLLIST_MESSAGE_MAP) - MESSAGE_HANDLER(WM_KEYDOWN, onChar) END_MSG_MAP() // Message handlers @@ -88,6 +85,7 @@ LRESULT onMoveDown(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT onDoubleClickList(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT onItemChanged(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); + LRESULT onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onContextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled); LRESULT onChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled); @@ -125,7 +123,6 @@ CButton ctrlMoveDown; CButton ctrlHelp; CMenu contextMenu; - CContainedWindow listContainer; // Column order enum Modified: dcplusplus/trunk/windows/DirectoryListingFrm.cpp =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -33,6 +33,7 @@ #include "../client/User.h" #include "../client/ClientManager.h" +DirectoryListingFrame::FrameMap DirectoryListingFrame::frames; int DirectoryListingFrame::columnIndexes[] = { COLUMN_FILENAME, COLUMN_TYPE, COLUMN_EXACTSIZE, COLUMN_SIZE, COLUMN_TTH }; int DirectoryListingFrame::columnSizes[] = { 300, 60, 100, 100, 200 }; @@ -55,6 +56,7 @@ frame->CreateEx(WinUtil::mdiClient); } frame->loadFile(aFile); + frames.insert( FramePair( frame->m_hWnd, frame ) ); } } @@ -71,6 +73,7 @@ frame->CreateEx(WinUtil::mdiClient); } frame->loadXML(txt); + frames.insert( FramePair( frame->m_hWnd, frame ) ); } } @@ -779,7 +782,7 @@ string target = SETTING(DOWNLOAD_DIRECTORY); try { dcassert(newId < (int)WinUtil::lastDirs.size()); - dl->download(dir, Text::fromT(WinUtil::lastDirs[newId]), (GetKeyState(VK_SHIFT) & 0x8000) > 0); + dl->download(dir, Text::fromT(WinUtil::lastDirs[newId]), WinUtil::isShift()); } catch(const Exception& e) { ctrlStatus.SetText(STATUS_TEXT, Text::toT(e.getError()).c_str()); } @@ -1080,3 +1083,8 @@ ClientManager::getInstance()->userCommand(dl->getUser(), uc, tmp, true); } } + +void DirectoryListingFrame::closeAll(){ + for(FrameIter i = frames.begin(); i != frames.end(); ++i) + i->second->PostMessage(WM_CLOSE, 0, 0); +} Modified: dcplusplus/trunk/windows/DirectoryListingFrm.h =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-06-03 11:12:22 UTC (rev 609) @@ -44,6 +44,7 @@ public: static void openWindow(const tstring& aFile, const User::Ptr& aUser, int64_t aSpeed); static void openWindow(const User::Ptr& aUser, const string& txt, int64_t aSpeed); + static void closeAll(); typedef MDITabChildWindowImpl<DirectoryListingFrame, RGB(255, 0, 255)> baseClass; typedef UCHandler<DirectoryListingFrame> ucBase; @@ -163,6 +164,7 @@ LRESULT onClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { ctrlList.SetRedraw(FALSE); clearList(); + frames.erase(m_hWnd); WinUtil::saveHeaderOrder(ctrlList, SettingsManager::DIRECTORLISTINGFRAME_ORDER, SettingsManager::DIRECTORLISTINGFRAME_WIDTHS, COLUMN_LAST, columnIndexes, columnSizes); bHandled = FALSE; return 0; @@ -354,6 +356,12 @@ static int columnIndexes[COLUMN_LAST]; static int columnSizes[COLUMN_LAST]; + + typedef map< HWND , DirectoryListingFrame* > FrameMap; + typedef pair< HWND , DirectoryListingFrame* > FramePair; + typedef FrameMap::iterator FrameIter; + + static FrameMap frames; }; #endif // !defined(DIRECTORY_LISTING_FRM_H) Modified: dcplusplus/trunk/windows/FavoriteDirsPage.cpp =================================================================== --- dcplusplus/trunk/windows/FavoriteDirsPage.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/FavoriteDirsPage.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -88,6 +88,33 @@ return 0; } +LRESULT FavoriteDirsPage::onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled) { + NMLVKEYDOWN* kd = (NMLVKEYDOWN*) pnmh; + switch(kd->wVKey) { + case VK_INSERT: + PostMessage(WM_COMMAND, IDC_ADD, 0); + break; + case VK_DELETE: + PostMessage(WM_COMMAND, IDC_REMOVE, 0); + break; + default: + bHandled = FALSE; + } + return 0; +} + +LRESULT FavoriteDirsPage::onDoubleClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { + NMITEMACTIVATE* item = (NMITEMACTIVATE*)pnmh; + + if(item->iItem >= 0) { + PostMessage(WM_COMMAND, IDC_RENAME, 0); + } else if(item->iItem == -1) { + PostMessage(WM_COMMAND, IDC_ADD, 0); + } + + return 0; +} + LRESULT FavoriteDirsPage::onClickedAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { tstring target; Modified: dcplusplus/trunk/windows/FavoriteDirsPage.h =================================================================== --- dcplusplus/trunk/windows/FavoriteDirsPage.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/FavoriteDirsPage.h 2006-06-03 11:12:22 UTC (rev 609) @@ -44,6 +44,8 @@ MESSAGE_HANDLER(WM_HELP, onHelp) MESSAGE_HANDLER(WM_DROPFILES, onDropFiles) NOTIFY_HANDLER(IDC_FAVORITE_DIRECTORIES, LVN_ITEMCHANGED, onItemchangedDirectories) + NOTIFY_HANDLER(IDC_FAVORITE_DIRECTORIES, LVN_KEYDOWN, onKeyDown) + NOTIFY_HANDLER(IDC_FAVORITE_DIRECTORIES, NM_DBLCLK, onDoubleClick) COMMAND_ID_HANDLER(IDC_ADD, onClickedAdd) COMMAND_ID_HANDLER(IDC_REMOVE, onClickedRemove) COMMAND_ID_HANDLER(IDC_RENAME, onClickedRename) @@ -54,6 +56,8 @@ LRESULT onDropFiles(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT onHelp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); LRESULT onItemchangedDirectories(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/); + LRESULT onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled); + LRESULT onDoubleClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onClickedAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onClickedRemove(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onClickedRename(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); Modified: dcplusplus/trunk/windows/FavoritesFrm.cpp =================================================================== --- dcplusplus/trunk/windows/FavoritesFrm.cpp 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/FavoritesFrm.cpp 2006-06-03 11:12:22 UTC (rev 609) @@ -152,19 +152,35 @@ } LRESULT FavoriteHubsFrame::onDoubleClickHublist(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - if(!checkNick()) - return 0; - NMITEMACTIVATE* item = (NMITEMACTIVATE*) pnmh; - if(item->iItem != -1) { - FavoriteHubEntry* entry = (FavoriteHubEntry*)ctrlHubs.GetItemData(item->iItem); - HubFrame::openWindow(Text::toT(entry->getServer())); + if(item->iItem == -1) { + PostMessage(WM_COMMAND, IDC_NEWFAV, 0); + } else { + PostMessage(WM_COMMAND, IDC_CONNECT, 0); } return 0; } +LRESULT FavoriteHubsFrame::onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled) { + NMLVKEYDOWN* kd = (NMLVKEYDOWN*) pnmh; + switch(kd->wVKey) { + case VK_INSERT: + PostMessage(WM_COMMAND, IDC_NEWFAV, 0); + break; + case VK_DELETE: + PostMessage(WM_COMMAND, IDC_REMOVE, 0); + break; + case VK_RETURN: + PostMessage(WM_COMMAND, IDC_CONNECT, 0); + break; + default: + bHandled = FALSE; + } + return 0; +} + LRESULT FavoriteHubsFrame::onRemove(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int i = -1; if(!BOOLSETTING(CONFIRM_HUB_REMOVAL) || MessageBox(CTSTRING(REALLY_REMOVE), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) == IDYES) { Modified: dcplusplus/trunk/windows/FavoritesFrm.h =================================================================== --- dcplusplus/trunk/windows/FavoritesFrm.h 2006-05-21 21:46:16 UTC (rev 608) +++ dcplusplus/trunk/windows/FavoritesFrm.h 2006-06-03 11:12:22 UTC (rev 609) @@ -52,14 +52,15 @@ COMMAND_ID_HANDLER(IDC_MOVE_DOWN, onMoveDown); // NOTIFY_HANDLER(IDC_HUBLIST, LVN_COLUMNCLICK, onColumnClickHublist) NOTIFY_HANDLER(IDC_HUBLIST, NM_DBLCLK, onDoubleClickHublist) - NOTIFY_HANDLER(IDC_HUBLIST, NM_RETURN, onEnter) + NOTIFY_HANDLER(IDC_HUBLIST, LVN_KEYDOWN, onKeyDown) NOTIFY_HANDLER(IDC_HUBLIST, LVN_ITEMCHANGED, onItemChanged... [truncated message content] |
From: <arn...@us...> - 2006-06-03 13:48:11
|
Revision: 610 Author: arnetheduck Date: 2006-06-03 06:47:39 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=610&view=rev Log Message: ----------- Passive adc search results Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.rc dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/AdcHub.h dcplusplus/trunk/client/DownloadManager.cpp dcplusplus/trunk/client/MerkleCheckOutputStream.h dcplusplus/trunk/client/SearchManager.cpp dcplusplus/trunk/client/SearchManager.h dcplusplus/trunk/client/version.h dcplusplus/trunk/windows/resource.h Modified: dcplusplus/trunk/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/DCPlusPlus.rc 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/DCPlusPlus.rc 2006-06-03 13:47:39 UTC (rev 610) @@ -933,8 +933,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,9,0 - PRODUCTVERSION 0,6,9,0 + FILEVERSION 0,6,9,1 + PRODUCTVERSION 0,6,9,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -951,12 +951,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 6, 9, 0" + VALUE "FileVersion", "0, 6, 9, 1" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 6, 9, 0" + VALUE "ProductVersion", "0, 6, 9, 1" END END BLOCK "VarFileInfo" Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 13:47:39 UTC (rev 610) @@ -47,16 +47,11 @@ } OnlineUser& AdcHub::getUser(const u_int32_t aSID, const CID& aCID) { - OnlineUser* u = NULL; - { - Lock l(cs); - - SIDIter i = users.find(aSID); - if(i != users.end()) - return *i->second; + OnlineUser* u = findUser(aSID); + if(u) { + return *u; } - User::Ptr p = ClientManager::getInstance()->getUser(aCID); { @@ -69,9 +64,9 @@ return *u; } -OnlineUser* AdcHub::findUser(const u_int32_t aSID) { +OnlineUser* AdcHub::findUser(const u_int32_t aSID) const { Lock l(cs); - SIDIter i = users.find(aSID); + SIDMap::const_iterator i = users.find(aSID); return i == users.end() ? NULL : i->second; } @@ -315,15 +310,24 @@ } void AdcHub::handle(AdcCommand::SCH, AdcCommand& c) throw() { - SIDMap::const_iterator i = users.find(c.getFrom()); - if(i == users.end()) { + OnlineUser* ou = findUser(c.getFrom()); + if(!ou) { dcdebug("Invalid user in AdcHub::onSCH\n"); return; } - fire(ClientListener::AdcSearch(), this, c, i->second->getUser()->getCID()); + fire(ClientListener::AdcSearch(), this, c, ou->getUser()->getCID()); } +void AdcHub::handle(AdcCommand::RES, AdcCommand& c) throw() { + OnlineUser* ou = findUser(c.getFrom()); + if(!ou) { + dcdebug("Invalid user in AdcHub::onRES\n"); + return; + } + SearchManager::getInstance()->onRES(c, ou->getUser()); +} + void AdcHub::connect(const OnlineUser& user) { u_int32_t r = Util::rand(); connect(user, Util::toString(r), BOOLSETTING(USE_SSL) && user.getUser()->isSet(User::SSL)); Modified: dcplusplus/trunk/client/AdcHub.h =================================================================== --- dcplusplus/trunk/client/AdcHub.h 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/AdcHub.h 2006-06-03 13:47:39 UTC (rev 610) @@ -91,7 +91,7 @@ virtual string checkNick(const string& nick); OnlineUser& getUser(const u_int32_t aSID, const CID& aCID); - OnlineUser* findUser(const u_int32_t sid); + OnlineUser* findUser(const u_int32_t sid) const; void putUser(const u_int32_t sid); void clearUsers(); @@ -107,6 +107,7 @@ void handle(AdcCommand::STA, AdcCommand& c) throw(); void handle(AdcCommand::SCH, AdcCommand& c) throw(); void handle(AdcCommand::CMD, AdcCommand& c) throw(); + void handle(AdcCommand::RES, AdcCommand& c) throw(); template<typename T> void handle(T, AdcCommand&) { //Speaker<AdcHubListener>::fire(t, this, c); Modified: dcplusplus/trunk/client/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/client/DownloadManager.cpp 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/DownloadManager.cpp 2006-06-03 13:47:39 UTC (rev 610) @@ -268,7 +268,8 @@ if(BOOLSETTING(ADVANCED_RESUME) && d->getTreeValid() && start > 0 && (d->getTigerTree().getLeaves().size() > 32 || // 32 leaves is 5 levels - d->getTigerTree().getBlockSize() * 10 < d->getSize())) { + d->getTigerTree().getBlockSize() * 10 < d->getSize())) + { d->setStartPos(getResumePos(d->getDownloadTarget(), d->getTigerTree(), start)); } else { int rollback = SETTING(ROLLBACK); @@ -326,19 +327,21 @@ int64_t DownloadManager::getResumePos(const string& file, const TigerTree& tt, int64_t startPos) { // Always discard data until the last block - startPos = startPos - (startPos % tt.getBlockSize()); if(startPos < tt.getBlockSize()) return 0; + startPos -= (startPos % tt.getBlockSize()); + DummyOutputStream dummy; vector<u_int8_t> buf((size_t)min((int64_t)1024*1024, tt.getBlockSize())); do { int64_t blockPos = startPos - tt.getBlockSize(); - MerkleCheckOutputStream<TigerTree, false> check(tt, &dummy, blockPos); try { + MerkleCheckOutputStream<TigerTree, false> check(tt, &dummy, blockPos); + File inFile(file, File::READ, File::OPEN); inFile.setPos(blockPos); int64_t bytesLeft = tt.getBlockSize(); Modified: dcplusplus/trunk/client/MerkleCheckOutputStream.h =================================================================== --- dcplusplus/trunk/client/MerkleCheckOutputStream.h 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/MerkleCheckOutputStream.h 2006-06-03 13:47:39 UTC (rev 610) @@ -32,10 +32,14 @@ MerkleCheckOutputStream(const TreeType& aTree, OutputStream* aStream, int64_t start) : s(aStream), real(aTree), cur(aTree.getBlockSize()), verified(0), bufPos(0) { // Only start at block boundaries dcassert(start % aTree.getBlockSize() == 0); - // Sanity check - dcassert(aTree.getLeaves().size() > (size_t)(start / aTree.getBlockSize())); cur.setFileSize(start); - cur.getLeaves().insert(cur.getLeaves().begin(), aTree.getLeaves().begin(), aTree.getLeaves().begin() + (size_t)(start / aTree.getBlockSize())); + + size_t nBlocks = static_cast<size_t>(start / aTree.getBlockSize()); + if(nBlocks > aTree.getLeaves().size()) { + dcdebug("Invalid tree / parameters"); + return; + } + cur.getLeaves().insert(cur.getLeaves().begin(), aTree.getLeaves().begin(), aTree.getLeaves().begin() + nBlocks); } virtual ~MerkleCheckOutputStream() throw() { if(managed) delete s; } Modified: dcplusplus/trunk/client/SearchManager.cpp =================================================================== --- dcplusplus/trunk/client/SearchManager.cpp 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/SearchManager.cpp 2006-06-03 13:47:39 UTC (rev 610) @@ -268,7 +268,7 @@ } SearchResult* sr = new SearchResult(user, type, slots, freeSlots, size, - file, hubName, url, remoteIp, tth.empty() ? NULL : new TTHValue(tth), false); + file, hubName, url, remoteIp, tth.empty() ? NULL : new TTHValue(tth), false, Util::emptyString); fire(SearchManagerListener::SR(), sr); sr->decRef(); } else if(x.compare(1, 4, "RES ") == 0 && x[x.length() - 1] == 0x0a) { @@ -283,38 +283,11 @@ if(!user) return; - int freeSlots = -1; - int64_t size = -1; - string file; - string tth; + // This should be handled by AdcCommand really... + c.getParameters().erase(c.getParameters().begin()); - for(StringIter i = c.getParameters().begin() + 1; i != c.getParameters().end(); ++i) { - string& str = *i; - if(str.compare(0, 2, "FN") == 0) { - file = Util::toNmdcFile(str.substr(2)); - } else if(str.compare(0, 2, "SL") == 0) { - freeSlots = Util::toInt(str.substr(2)); - } else if(str.compare(0, 2, "SI") == 0) { - size = Util::toInt64(str.substr(2)); - } else if(str.compare(0, 2, "TR") == 0) { - tth = str.substr(2); - } - } + onRES(c, user, remoteIp); - if(!file.empty() && freeSlots != -1 && size != -1) { - - StringList names = ClientManager::getInstance()->getHubNames(user->getCID()); - string hubName = names.empty() ? STRING(OFFLINE) : Util::toString(names); - StringList hubs = ClientManager::getInstance()->getHubs(user->getCID()); - string hub = hubs.empty() ? STRING(OFFLINE) : Util::toString(hubs); - - SearchResult::Types type = (file[file.length() - 1] == '\\' ? SearchResult::TYPE_DIRECTORY : SearchResult::TYPE_FILE); - /// @todo Something about the slots - SearchResult* sr = new SearchResult(user, type, 0, freeSlots, size, - file, hubName, hub, remoteIp, tth.empty() ? NULL : new TTHValue(tth), true); - fire(SearchManagerListener::SR(), sr); - sr->decRef(); - } } /*else if(x.compare(1, 4, "SCH ") == 0 && x[x.length() - 1] == 0x0a) { try { respond(AdcCommand(x.substr(0, x.length()-1))); @@ -323,6 +296,44 @@ }*/ // Needs further DoS investigation } +void SearchManager::onRES(const AdcCommand& cmd, const User::Ptr& from, const string& remoteIp) { + int freeSlots = -1; + int64_t size = -1; + string file; + string tth; + string token; + + for(StringIterC i = cmd.getParameters().begin(); i != cmd.getParameters().end(); ++i) { + const string& str = *i; + if(str.compare(0, 2, "FN") == 0) { + file = Util::toNmdcFile(str.substr(2)); + } else if(str.compare(0, 2, "SL") == 0) { + freeSlots = Util::toInt(str.substr(2)); + } else if(str.compare(0, 2, "SI") == 0) { + size = Util::toInt64(str.substr(2)); + } else if(str.compare(0, 2, "TR") == 0) { + tth = str.substr(2); + } else if(str.compare(0, 2, "TO") == 0) { + token = str.substr(2); + } + } + + if(!file.empty() && freeSlots != -1 && size != -1) { + + StringList names = ClientManager::getInstance()->getHubNames(from->getCID()); + string hubName = names.empty() ? STRING(OFFLINE) : Util::toString(names); + StringList hubs = ClientManager::getInstance()->getHubs(from->getCID()); + string hub = hubs.empty() ? STRING(OFFLINE) : Util::toString(hubs); + + SearchResult::Types type = (file[file.length() - 1] == '\\' ? SearchResult::TYPE_DIRECTORY : SearchResult::TYPE_FILE); + /// @todo Something about the slots + SearchResult* sr = new SearchResult(from, type, 0, freeSlots, size, + file, hubName, hub, remoteIp, tth.empty() ? NULL : new TTHValue(tth), true, token); + fire(SearchManagerListener::SR(), sr); + sr->decRef(); + } +} + void SearchManager::respond(const AdcCommand& adc, const CID& from) { // Filter own searches if(from == ClientManager::getInstance()->getMe()->getCID()) Modified: dcplusplus/trunk/client/SearchManager.h =================================================================== --- dcplusplus/trunk/client/SearchManager.h 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/SearchManager.h 2006-06-03 13:47:39 UTC (rev 610) @@ -55,10 +55,10 @@ SearchResult(const User::Ptr& aUser, Types aType, int aSlots, int aFreeSlots, int64_t aSize, const string& aFile, const string& aHubName, - const string& aHubURL, const string& ip, TTHValue* aTTH, bool aUtf8) : + const string& aHubURL, const string& ip, TTHValue* aTTH, bool aUtf8, const string& aToken) : file(aFile), hubName(aHubName), hubURL(aHubURL), user(aUser), size(aSize), type(aType), slots(aSlots), freeSlots(aFreeSlots), IP(ip), - tth((aTTH != NULL) ? new TTHValue(*aTTH) : NULL), utf8(aUtf8), ref(1) { } + tth((aTTH != NULL) ? new TTHValue(*aTTH) : NULL), token(aToken), utf8(aUtf8), ref(1) { } string getFileName() const; string toSR(const Client& client) const; @@ -77,6 +77,7 @@ TTHValue* getTTH() const { return tth; } bool getUtf8() const { return utf8; } const string& getIP() const { return IP; } + const string& getToken() const { return token; } void incRef() { Thread::safeInc(ref); } void decRef() { @@ -102,6 +103,7 @@ int freeSlots; string IP; TTHValue* tth; + string token; bool utf8; volatile long ref; @@ -151,6 +153,8 @@ void onSearchResult(const string& aLine) { onData((const u_int8_t*)aLine.data(), aLine.length(), Util::emptyString); } + + void onRES(const AdcCommand& cmd, const User::Ptr& from, const string& removeIp = Util::emptyString); int32_t timeToSearch() { return (int32_t)(((((int64_t)lastSearch) + 5000) - GET_TICK() ) / 1000); Modified: dcplusplus/trunk/client/version.h =================================================================== --- dcplusplus/trunk/client/version.h 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/client/version.h 2006-06-03 13:47:39 UTC (rev 610) @@ -17,8 +17,8 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.69" -#define VERSIONFLOAT 0.69 +#define VERSIONSTRING "0.691" +#define VERSIONFLOAT 0.691 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/windows/resource.h =================================================================== --- dcplusplus/trunk/windows/resource.h 2006-06-03 11:12:22 UTC (rev 609) +++ dcplusplus/trunk/windows/resource.h 2006-06-03 13:47:39 UTC (rev 610) @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by f:\Programmering\C++\dcplusplus\DCPlusPlus.rc +// Used by c:\Documents\VCProjects\DCPlusPlus\DCPlusPlus.rc // #define IDD_ABOUTBOX 100 #define IDC_TRAY_QUIT 102 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-06-03 14:18:19
|
Revision: 611 Author: arnetheduck Date: 2006-06-03 07:17:47 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=611&view=rev Log Message: ----------- Fixed user list filter Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/PublicHubsFrm.cpp dcplusplus/trunk/windows/PublicHubsFrm.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-06-03 13:47:39 UTC (rev 610) +++ dcplusplus/trunk/changelog.txt 2006-06-03 14:17:47 UTC (rev 611) @@ -9,8 +9,10 @@ * [bug 927] Fixed OP detection bug (thanks pothead) * [bug 929] Fixed list view flicker issues (thanks trem) * [bug 931] Improved keyboard navigation (thanks trem) +* Added "all" to hub list field search (thanks trem) * Fixed bug when sending active ADC search results * Updated to ADC 0.11 +* Passive users now also get search results -- 0.69 2006-05-21 -- * Small linux / old gcc fixes (thanks jens oknelid) Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-06-03 13:47:39 UTC (rev 610) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-06-03 14:17:47 UTC (rev 611) @@ -126,7 +126,8 @@ for(int j=0; j<COLUMN_LAST; j++) { ctrlFilterSel.AddString(CTSTRING_I(columnNames[j])); } - ctrlFilterSel.SetCurSel(0); + ctrlFilterSel.AddString(CTSTRING(ANY)); + ctrlFilterSel.SetCurSel(COLUMN_LAST); bHandled = FALSE; client->connect(); @@ -1306,31 +1307,31 @@ return 0; } -bool HubFrame::parseFilter(int& mode, int64_t& size) { +bool HubFrame::parseFilter(FilterModes& mode, int64_t& size) { tstring::size_type start = tstring::npos; tstring::size_type end = tstring::npos; int64_t multiplier = 1; if(filter.compare(0, 2, _T(">=")) == 0) { - mode = 1; + mode = FilterModes::GREATER_EQUAL; start = 2; } else if(filter.compare(0, 2, _T("<=")) == 0) { - mode = 2; + mode = FilterModes::LESS_EQUAL; start = 2; } else if(filter.compare(0, 2, _T("==")) == 0) { - mode = 0; + mode = FilterModes::EQUAL; start = 2; } else if(filter.compare(0, 2, _T("!=")) == 0) { - mode = 5; + mode = FilterModes::NOT_EQUAL; start = 2; } else if(filter[0] == _T('<')) { - mode = 4; + mode = FilterModes::LESS; start = 1; } else if(filter[0] == _T('>')) { - mode = 3; + mode = FilterModes::GREATER; start = 1; } else if(filter[0] == _T('=')) { - mode = 1; + mode = FilterModes::EQUAL; start = 1; } @@ -1372,7 +1373,7 @@ void HubFrame::updateUserList(UserInfo* ui) { int64_t size = -1; - int mode = -1; + FilterModes mode = FilterModes::NONE; int sel = ctrlFilterSel.GetCurSel(); @@ -1449,14 +1450,7 @@ } } -bool HubFrame::matchFilter(const UserInfo& ui, int sel, bool doSizeCompare, int mode, int64_t size) { - //mode - //0 - == - //1 - >= - //2 - <= - //3 - > - //4 - < - //5 - != +bool HubFrame::matchFilter(const UserInfo& ui, int sel, bool doSizeCompare, FilterModes mode, int64_t size) { if(filter.empty()) return true; @@ -1464,16 +1458,25 @@ bool insert = false; if(doSizeCompare) { switch(mode) { - case 0: insert = (size == ui.getIdentity().getBytesShared()); break; - case 1: insert = (size <= ui.getIdentity().getBytesShared()); break; - case 2: insert = (size >= ui.getIdentity().getBytesShared()); break; - case 3: insert = (size < ui.getIdentity().getBytesShared()); break; - case 4: insert = (size > ui.getIdentity().getBytesShared()); break; - case 5: insert = (size != ui.getIdentity().getBytesShared()); break; + case FilterModes::EQUAL: insert = (size == ui.getIdentity().getBytesShared()); break; + case FilterModes::GREATER_EQUAL: insert = (size <= ui.getIdentity().getBytesShared()); break; + case FilterModes::LESS_EQUAL: insert = (size >= ui.getIdentity().getBytesShared()); break; + case FilterModes::GREATER: insert = (size < ui.getIdentity().getBytesShared()); break; + case FilterModes::LESS: insert = (size > ui.getIdentity().getBytesShared()); break; + case FilterModes::NOT_EQUAL: insert = (size != ui.getIdentity().getBytesShared()); break; } } else { - if(Util::findSubString(ui.getText(sel), filter) != string::npos) - insert = true; + if(sel >= COLUMN_LAST) { + for(int i = COLUMN_FIRST; i < COLUMN_LAST; ++i) { + if(Util::findSubString(ui.getText(i), filter) != string::npos) { + insert = true; + break; + } + } + } else { + if(Util::findSubString(ui.getText(sel), filter) != string::npos) + insert = true; + } } return insert; Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-06-03 13:47:39 UTC (rev 610) +++ dcplusplus/trunk/windows/HubFrame.h 2006-06-03 14:17:47 UTC (rev 611) @@ -178,6 +178,16 @@ COLUMN_LAST }; + enum FilterModes{ + NONE, + EQUAL, + GREATER_EQUAL, + LESS_EQUAL, + GREATER, + LESS, + NOT_EQUAL + }; + struct Task { Task(Speakers speaker_) : speaker(speaker_) { } virtual ~Task() { } @@ -354,8 +364,8 @@ void removeUser(const User::Ptr& aUser); void updateUserList(UserInfo* ui = NULL); - bool parseFilter(int& mode, int64_t& size); - bool matchFilter(const UserInfo& ui, int sel, bool doSizeCompare = false, int mode = 0, int64_t size = 0); + bool parseFilter(FilterModes& mode, int64_t& size); + bool matchFilter(const UserInfo& ui, int sel, bool doSizeCompare = false, FilterModes mode = FilterModes::NONE, int64_t size = 0); UserInfo* findUser(const tstring& nick); void addAsFavorite(); Modified: dcplusplus/trunk/windows/PublicHubsFrm.cpp =================================================================== --- dcplusplus/trunk/windows/PublicHubsFrm.cpp 2006-06-03 13:47:39 UTC (rev 610) +++ dcplusplus/trunk/windows/PublicHubsFrm.cpp 2006-06-03 14:17:47 UTC (rev 611) @@ -126,8 +126,8 @@ for(int j=0; j<COLUMN_LAST; j++) { ctrlFilterSel.AddString(CTSTRING_I(columnNames[j])); } - - ctrlFilterSel.SetCurSel(0); + ctrlFilterSel.AddString(CTSTRING(ANY)); + ctrlFilterSel.SetCurSel(COLUMN_LAST); ctrlFilterDesc.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_GROUPBOX, WS_EX_TRANSPARENT); @@ -383,7 +383,7 @@ ctrlHubs.SetRedraw(FALSE); double size = -1; - int mode = -1; + FilterModes mode = FilterModes::NONE; int sel = ctrlFilterSel.GetCurSel(); @@ -489,31 +489,31 @@ ctrlPubLists.SetCurSel(FavoriteManager::getInstance()->getSelectedHubList()); } -bool PublicHubsFrame::parseFilter(int& mode, double& size) { +bool PublicHubsFrame::parseFilter(FilterModes& mode, double& size) { string::size_type start = (string::size_type)string::npos; string::size_type end = (string::size_type)string::npos; int64_t multiplier = 1; - if(Util::strnicmp(filter.c_str(), ">=", 2) == 0) { - mode = 1; + if(filter.compare(0, 2, ">=") == 0) { + mode = FilterModes::GREATER_EQUAL; start = 2; - } else if(Util::strnicmp(filter.c_str(), "<=", 2) == 0) { - mode = 2; + } else if(filter.compare(0, 2, "<=") == 0) { + mode = FilterModes::LESS_EQUAL; start = 2; - } else if(Util::strnicmp(filter.c_str(), "==", 2) == 0) { - mode = 0; + } else if(filter.compare(0, 2, "==") == 0) { + mode = FilterModes::EQUAL; start = 2; - } else if(Util::strnicmp(filter.c_str(), "!=", 2) == 0) { - mode = 5; + } else if(filter.compare(0, 2, "!=") == 0) { + mode = FilterModes::NOT_EQUAL; start = 2; - } else if(filter[0] == '<') { - mode = 4; + } else if(filter[0] == _T('<')) { + mode = FilterModes::LESS; start = 1; - } else if(filter[0] == '>') { - mode = 3; + } else if(filter[0] == _T('>')) { + mode = FilterModes::GREATER; start = 1; - } else if(filter[0] == '=') { - mode = 1; + } else if(filter[0] == _T('=')) { + mode = FilterModes::EQUAL; start = 1; } @@ -553,15 +553,7 @@ return true; } -bool PublicHubsFrame::matchFilter(const HubEntry& entry, const int& sel, bool doSizeCompare, const int& mode, const double& size) { - //mode - //0 - == - //1 - >= - //2 - <= - //3 - > - //4 - < - //5 - != - +bool PublicHubsFrame::matchFilter(const HubEntry& entry, const int& sel, bool doSizeCompare, const FilterModes& mode, const double& size) { if(filter.empty()) return true; @@ -587,14 +579,23 @@ bool insert = false; if(doSizeCompare) { switch(mode) { - case 0: insert = (size == entrySize); break; - case 1: insert = (size <= entrySize); break; - case 2: insert = (size >= entrySize); break; - case 3: insert = (size < entrySize); break; - case 4: insert = (size > entrySize); break; - case 5: insert = (size != entrySize); break; + case FilterModes::EQUAL: insert = (size == entrySize); break; + case FilterModes::GREATER_EQUAL: insert = (size <= entrySize); break; + case FilterModes::LESS_EQUAL: insert = (size >= entrySize); break; + case FilterModes::GREATER: insert = (size < entrySize); break; + case FilterModes::LESS: insert = (size > entrySize); break; + case FilterModes::NOT_EQUAL: insert = (size != entrySize); break; } } else { + if(sel >= COLUMN_LAST) { + if( Util::findSubString(entry.getName(), filter) != string::npos || + Util::findSubString(entry.getDescription(), filter) != string::npos || + Util::findSubString(entry.getServer(), filter) != string::npos || + Util::findSubString(entry.getCountry(), filter) != string::npos || + Util::findSubString(entry.getRating(), filter) != string::npos ) { + insert = true; + } + } if(Util::findSubString(entryString, filter) != string::npos) insert = true; } Modified: dcplusplus/trunk/windows/PublicHubsFrm.h =================================================================== --- dcplusplus/trunk/windows/PublicHubsFrm.h 2006-06-03 13:47:39 UTC (rev 610) +++ dcplusplus/trunk/windows/PublicHubsFrm.h 2006-06-03 14:17:47 UTC (rev 611) @@ -128,6 +128,16 @@ FAILED }; + enum FilterModes{ + NONE, + EQUAL, + GREATER_EQUAL, + LESS_EQUAL, + GREATER, + LESS, + NOT_EQUAL + }; + int visibleHubs; int users; CStatusBarCtrl ctrlStatus; @@ -163,8 +173,8 @@ void updateList(); void updateDropDown(); - bool parseFilter(int& mode, double& size); - bool matchFilter(const HubEntry& entry, const int& sel, bool doSizeCompare, const int& mode, const double& size); + bool parseFilter(FilterModes& mode, double& size); + bool matchFilter(const HubEntry& entry, const int& sel, bool doSizeCompare, const FilterModes& mode, const double& size); }; #endif // !defined(PUBLIC_HUBS_FRM_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-06-06 02:30:44
|
Revision: 612 Author: arnetheduck Date: 2006-06-03 14:38:06 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=612&view=rev Log Message: ----------- bot detection fix Modified Paths: -------------- dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/NmdcHub.cpp dcplusplus/trunk/client/User.cpp dcplusplus/trunk/client/User.h dcplusplus/trunk/help/changelog.html Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/Example.xml 2006-06-03 21:38:06 UTC (rev 612) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.69" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.691" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/changelog.txt 2006-06-03 21:38:06 UTC (rev 612) @@ -1,4 +1,4 @@ --- 0.691 -- +-- 0.691 2006-06-03 -- * Links to bugzilla in html changelog * [bug 122] Added userlist filter (thanks trem) * [bug 578] Added search for alternates to transfers menu (thanks trem) @@ -12,7 +12,8 @@ * Added "all" to hub list field search (thanks trem) * Fixed bug when sending active ADC search results * Updated to ADC 0.11 -* Passive users now also get search results +* Passive users now also get ADC search results +* Changed nmdc bot-detection to what it was before, should fix pm-to-bot bug -- 0.69 2006-05-21 -- * Small linux / old gcc fixes (thanks jens oknelid) Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 21:38:06 UTC (rev 612) @@ -119,6 +119,12 @@ u->getIdentity().set(i->c_str(), i->substr(2)); } + if(u->getIdentity().isBot()) { + u->getUser()->setFlag(User::BOT); + } else { + u->getUser()->unsetFlag(User::BOT); + } + if(u->getUser()->getFirstNick().empty()) { u->getUser()->setFirstNick(u->getIdentity().getNick()); } Modified: dcplusplus/trunk/client/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/client/NmdcHub.cpp 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/NmdcHub.cpp 2006-06-03 21:38:06 UTC (rev 612) @@ -93,8 +93,6 @@ getMyIdentity().setHubUrl(getHubUrl()); } else { p = ClientManager::getInstance()->getUser(aNick, getHubUrl()); - // In NMDC, everyone's a bot until they show a good myinfo - p->setFlag(User::BOT); } { @@ -319,8 +317,6 @@ OnlineUser& u = getUser(nick); - u.getUser()->unsetFlag(User::BOT); - j = param.find('$', i); if(j == string::npos) return; @@ -342,7 +338,15 @@ if(j == string::npos) return; - u.getIdentity().setConnection(param.substr(i, j-i-1)); + string connection = param.substr(i, j-i-1); + if(connection.empty()) { + // No connection = bot... + u.getUser()->setFlag(User::BOT); + } else { + u.getUser()->unsetFlag(User::BOT); + } + + u.getIdentity().setConnection(connection); i = j + 1; j = param.find('$', i); Modified: dcplusplus/trunk/client/User.cpp =================================================================== --- dcplusplus/trunk/client/User.cpp 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/User.cpp 2006-06-03 21:38:06 UTC (rev 612) @@ -55,8 +55,8 @@ } } -const bool Identity::supports(const string& name) const { - string su = get("SU"); +bool Identity::supports(const string& name) const { + const string& su = get("SU"); StringTokenizer<string> st(su, ','); for(StringIter i = st.getTokens().begin(); i != st.getTokens().end(); ++i) { if(*i == name) Modified: dcplusplus/trunk/client/User.h =================================================================== --- dcplusplus/trunk/client/User.h 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/client/User.h 2006-06-03 21:38:06 UTC (rev 612) @@ -124,12 +124,13 @@ get("HR") + "/" + get("HO") + ",S:" + get("SL") + ">"; } - const bool supports(const string& name) const; - const bool isHub() const { return !get("HU").empty(); } - const bool isOp() const { return !get("OP").empty(); } - const bool isHidden() const { return !get("HI").empty(); } - const bool isTcpActive() const { return !getIp().empty() || (user->isSet(User::NMDC) && !user->isSet(User::PASSIVE)); } - const bool isUdpActive() const { return !getIp().empty() && !getUdpPort().empty(); } + bool supports(const string& name) const; + bool isHub() const { return !get("HU").empty(); } + bool isOp() const { return !get("OP").empty(); } + bool isHidden() const { return !get("HI").empty(); } + bool isBot() const { return !get("BO").empty(); } + bool isTcpActive() const { return !getIp().empty() || (user->isSet(User::NMDC) && !user->isSet(User::PASSIVE)); } + bool isUdpActive() const { return !getIp().empty() && !getUdpPort().empty(); } const string& get(const char* name) const { InfMap::const_iterator i = info.find(*(short*)name); Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-06-03 14:17:47 UTC (rev 611) +++ dcplusplus/trunk/help/changelog.html 2006-06-03 21:38:06 UTC (rev 612) @@ -13,6 +13,25 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.691 <span style="color: gray;">(2006-06-03)</span></h2> +<ul> + <li>Links to bugzilla in html changelog</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=122">[bug 122]</a> Added userlist filter (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=578">[bug 578]</a> Added search for alternates to transfers menu (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=861">[bug 861]</a> Fixed auto-prio not being set correctly (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=878">[bug 878]</a> Added close all ... to window menu (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=903">[bug 903]</a> Holding shift while minimizing will use opposite tray setting (thanks joakim tosteberg)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=923">[bug 923]</a> PM history always read (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=927">[bug 927]</a> Fixed OP detection bug (thanks pothead)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=929">[bug 929]</a> Fixed list view flicker issues (thanks trem)</li> + <li><a href="http://dcpp.net/bugzilla/show_bug.cgi?id=931">[bug 931]</a> Improved keyboard navigation (thanks trem)</li> + <li>Added "all" to hub list field search (thanks trem)</li> + <li>Fixed bug when sending active ADC search results</li> + <li>Updated to ADC 0.11</li> + <li>Passive users now also get ADC search results</li> + <li>Changed nmdc bot-detection to what it was before, should fix pm-to-bot bug</li> +</ul> + <h2>0.69 <span style="color: gray;">(2006-05-21)</span></h2> <ul> <li>Small linux / old gcc fixes (thanks jens oknelid)</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-06-10 09:48:53
|
Revision: 614 Author: arnetheduck Date: 2006-06-10 02:48:17 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=614&view=rev Log Message: ----------- patches Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/AdcHub.cpp dcplusplus/trunk/client/ClientManager.cpp dcplusplus/trunk/client/CriticalSection.h dcplusplus/trunk/client/HashManager.cpp dcplusplus/trunk/client/Text.cpp dcplusplus/trunk/client/Thread.cpp dcplusplus/trunk/client/Thread.h dcplusplus/trunk/client/Util.cpp dcplusplus/trunk/windows/AboutDlg.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/changelog.txt 2006-06-10 09:48:17 UTC (rev 614) @@ -1,4 +1,15 @@ --- 0.691 2006-06-03 -- +-- 0.692 -- +* [bug 927] Fixed OP detection bug really (thanks pothead) +* [bug 938] Added a few more ADC info fields (thanks ullner) +* [bug 939] Fixed hub info update (thanks ullner) +* [bug 940] Fixed a 64-bit compile error (thanks steven sheehy) +* [bug 942] Fixed atomic operations on unices (thanks tobias nygren) +* [bug 943] Fixed unix utsname compile issue (thanks tobias nygren) +* [bug 944] Fixed unix string conversion bug (thanks tobias nygren) +* [bug 945] Fixed unix mutex initialiser (thanks tobias nygren) + + +-- 0.691 2006-06-03 -- * Links to bugzilla in html changelog * [bug 122] Added userlist filter (thanks trem) * [bug 578] Added search for alternates to transfers menu (thanks trem) Modified: dcplusplus/trunk/client/AdcHub.cpp =================================================================== --- dcplusplus/trunk/client/AdcHub.cpp 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/AdcHub.cpp 2006-06-10 09:48:17 UTC (rev 614) @@ -133,17 +133,18 @@ u->getUser()->setFlag(User::SSL); } - if(u->getIdentity().isHub()) { - setHubIdentity(u->getIdentity()); - fire(ClientListener::HubUpdated(), this); - } - if(u->getUser() == ClientManager::getInstance()->getMe()) { state = STATE_NORMAL; setMyIdentity(u->getIdentity()); updateCounts(false); } - fire(ClientListener::UserUpdated(), this, *u); + + if(u->getIdentity().isHub()) { + setHubIdentity(u->getIdentity()); + fire(ClientListener::HubUpdated(), this); + } else { + fire(ClientListener::UserUpdated(), this, *u); + } } void AdcHub::handle(AdcCommand::SUP, AdcCommand& c) throw() { @@ -462,7 +463,20 @@ ADDPARAM("HR", Util::toString(counts.registered)); ADDPARAM("HO", Util::toString(counts.op)); ADDPARAM("VE", "++ " VERSIONSTRING); + ADDPARAM("US", Util::toString((long)(Util::toDouble(SETTING(UPLOAD_SPEED))*1024*1024))); + if(SETTING(MAX_DOWNLOAD_SPEED) > 0) { + ADDPARAM("DS", Util::toString((SETTING(MAX_DOWNLOAD_SPEED)*1024*8))); + } else { + ADDPARAM("DS", Util::emptyString); + } + + if(Util::getAway()){ + ADDPARAM("AW", '1'); + } else { + ADDPARAM("AW", Util::emptyString); + } + string su; if(SSLSocketFactory::getInstance()->hasCerts()) { su += ADCS_FEATURE + ","; Modified: dcplusplus/trunk/client/ClientManager.cpp =================================================================== --- dcplusplus/trunk/client/ClientManager.cpp 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/ClientManager.cpp 2006-06-10 09:48:17 UTC (rev 614) @@ -238,7 +238,7 @@ pair<OnlineIter, OnlineIter> p = onlineUsers.equal_range(user->getCID()); for(OnlineIter i = p.first; i != p.second; ++i) { if(i->second->getClient().getHubUrl() == aHubUrl) { - return i->second->getClient().getMyIdentity().isOp(); + return i->second->getIdentity().isOp(); } } return false; Modified: dcplusplus/trunk/client/CriticalSection.h =================================================================== --- dcplusplus/trunk/client/CriticalSection.h 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/CriticalSection.h 2006-06-10 09:48:17 UTC (rev 614) @@ -51,19 +51,20 @@ #else public: CriticalSection() throw() { -#if HAVE_DECL_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP - static pthread_mutex_t recmtx = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; - mtx = recmtx; -#else -#error Can not find mutex type attribute. -#endif + pthread_mutexattr_init(&ma); + pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mtx, &ma); } - ~CriticalSection() throw() { pthread_mutex_destroy(&mtx); } + ~CriticalSection() throw() { + pthread_mutex_destroy(&mtx); + pthread_mutexattr_destroy(&ma); + } void enter() throw() { pthread_mutex_lock(&mtx); } void leave() throw() { pthread_mutex_unlock(&mtx); } pthread_mutex_t& getMutex() { return mtx; } private: pthread_mutex_t mtx; + pthread_mutexattr_t ma; #endif CriticalSection(const CriticalSection&); CriticalSection& operator=(const CriticalSection&); Modified: dcplusplus/trunk/client/HashManager.cpp =================================================================== --- dcplusplus/trunk/client/HashManager.cpp 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/HashManager.cpp 2006-06-10 09:48:17 UTC (rev 614) @@ -631,7 +631,7 @@ { Lock l(cs); - currentSize = max(currentSize - n, _LL(0)); + currentSize = max(static_cast<u_int64_t>(currentSize - n), static_cast<u_int64_t>(0)); } sizeLeft -= n; } while (n > 0 && !stop); Modified: dcplusplus/trunk/client/Text.cpp =================================================================== --- dcplusplus/trunk/client/Text.cpp 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/Text.cpp 2006-06-10 09:48:17 UTC (rev 614) @@ -148,6 +148,7 @@ if (n < 1) { return tmp; } + src = str.c_str(); tmp.resize(n); n = mbsrtowcs(&tmp[0], &src, n, NULL); if (n < 1) { @@ -188,6 +189,7 @@ if(n < 1) { return tmp; } + src = str.c_str(); tmp.resize(n); n = wcsrtombs(&tmp[0], &src, n, NULL); if(n < 1) { Modified: dcplusplus/trunk/client/Thread.cpp =================================================================== --- dcplusplus/trunk/client/Thread.cpp 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/Thread.cpp 2006-06-10 09:48:17 UTC (rev 614) @@ -23,6 +23,10 @@ #include "ResourceManager.h" +#ifndef _WIN32 +pthread_mutex_t Thread::mtx = PTHREAD_MUTEX_INITIALIZER; +#endif + #ifdef _WIN32 void Thread::start() throw(ThreadException) { join(); Modified: dcplusplus/trunk/client/Thread.h =================================================================== --- dcplusplus/trunk/client/Thread.h 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/Thread.h 2006-06-10 09:48:17 UTC (rev 614) @@ -29,10 +29,6 @@ #include <sys/resource.h> #endif -#ifdef HAVE_ASM_ATOMIC_H -#include <asm/atomic.h> -#endif - #include "Exception.h" STANDARD_EXCEPTION(ThreadException); @@ -98,24 +94,16 @@ 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 - atomic_t t = ATOMIC_INIT(v); - atomic_inc(&t); - return (v=t.counter); -#else -#warning FIXME - return ++v; -#endif + pthread_mutex_lock(&mtx); + long ret = ++v; + pthread_mutex_unlock(&mtx); + return ret; } static long safeDec(volatile long& v) { -#ifdef HAVE_ASM_ATOMIC_H - atomic_t t = ATOMIC_INIT(v); - atomic_dec(&t); - return (v=t.counter); -#else -#warning FIXME - return --v; -#endif + pthread_mutex_lock(&mtx); + long ret = --v; + pthread_mutex_unlock(&mtx); + return ret; } #endif @@ -135,6 +123,7 @@ return 0; } #else + static pthread_mutex_t mtx; pthread_t threadHandle; static void* starter(void* p) { Thread* t = (Thread*)p; Modified: dcplusplus/trunk/client/Util.cpp =================================================================== --- dcplusplus/trunk/client/Util.cpp 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/client/Util.cpp 2006-06-10 09:48:17 UTC (rev 614) @@ -915,7 +915,7 @@ return os; #else // _WIN32 - utsname n; + struct utsname n; if(uname(&n) != 0) { return "unix (unknown version)"; Modified: dcplusplus/trunk/windows/AboutDlg.h =================================================================== --- dcplusplus/trunk/windows/AboutDlg.h 2006-06-03 21:53:22 UTC (rev 613) +++ dcplusplus/trunk/windows/AboutDlg.h 2006-06-10 09:48:17 UTC (rev 614) @@ -41,7 +41,8 @@ _T("theparanoidone, gadget, naga, tremor, joakim tosteberg, pofis, psf8500, lauris ievins, ") _T("defr, ullner, fleetcommand, liny, xan, olle svensson, mark gillespie, jeremy huddleston, ") _T("bsod, sulan, jonathan stone, tim burton, izzzo, guitarm, paka, nils maier, jens oknelid, yoji, ") -_T("krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin, jove, bart vullings, steven. ") +_T("krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin, jove, bart vullings, steven, ") +_T("steven sheehy, tobias nygren. ") _T("Keep it coming!"); class AboutDlg : public CDialogImpl<AboutDlg>, private HttpConnectionListener This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-06-13 20:04:19
|
Revision: 615 Author: arnetheduck Date: 2006-06-13 13:03:56 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=615&view=rev Log Message: ----------- Tiger patch Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/TigerHash.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-06-10 09:48:17 UTC (rev 614) +++ dcplusplus/trunk/changelog.txt 2006-06-13 20:03:56 UTC (rev 615) @@ -7,8 +7,8 @@ * [bug 943] Fixed unix utsname compile issue (thanks tobias nygren) * [bug 944] Fixed unix string conversion bug (thanks tobias nygren) * [bug 945] Fixed unix mutex initialiser (thanks tobias nygren) +* [bug 946] Tiger hash supports big endian and 64-bit architectures (thanks tobias nygren) - -- 0.691 2006-06-03 -- * Links to bugzilla in html changelog * [bug 122] Added userlist filter (thanks trem) Modified: dcplusplus/trunk/client/TigerHash.cpp =================================================================== --- dcplusplus/trunk/client/TigerHash.cpp 2006-06-10 09:48:17 UTC (rev 614) +++ dcplusplus/trunk/client/TigerHash.cpp 2006-06-13 20:03:56 UTC (rev 615) @@ -21,6 +21,22 @@ #include "TigerHash.h" +#ifdef _WIN32 +#if defined(_M_X64) +#define TIGER_ARCH64 +#endif +#if !(defined(_M_IX86) || defined(_M_X64)) +#define TIGER_BIG_ENDIAN +#endif +#else // _WIN32 +#if defined(__x86_64__) || defined(__alpha) +#define TIGER_ARCH64 +#endif +#if !(defined(__i386__) || defined(__x86_64__) || defined(__alpha)) +#define TIGER_BIG_ENDIAN +#endif +#endif // _WIN32 + #define PASSES 3 #define t1 (table) @@ -33,8 +49,17 @@ bb = b; \ cc = c; +#ifdef TIGER_ARCH64 #define round(a,b,c,x,mul) \ c ^= x; \ + a -= t1[((c)>>(0*8))&0xFF] ^ t2[((c)>>(2*8))&0xFF] ^ \ + t3[((c)>>(4*8))&0xFF] ^ t4[((c)>>(6*8))&0xFF] ; \ + b += t4[((c)>>(1*8))&0xFF] ^ t3[((c)>>(3*8))&0xFF] ^ \ + t2[((c)>>(5*8))&0xFF] ^ t1[((c)>>(7*8))&0xFF] ; \ + b *= mul; +#else +#define round(a,b,c,x,mul) \ + c ^= x; \ a -= t1[(u_int8_t)(c)] ^ \ t2[(u_int8_t)(((u_int32_t)(c))>>(2*8))] ^ \ t3[(u_int8_t)((c)>>(4*8))] ^ \ @@ -44,6 +69,7 @@ t2[(u_int8_t)(((u_int32_t)((c)>>(4*8)))>>(1*8))] ^ \ t1[(u_int8_t)(((u_int32_t)((c)>>(4*8)))>>(3*8))]; \ b *= mul; +#endif #define pass(a,b,c,mul) \ round(a,b,c,x0,mul) \ @@ -78,13 +104,28 @@ b -= bb; \ c += cc; +#ifdef TIGER_ARCH64 #define compress \ save_abc \ + pass(a,b,c,5) \ + key_schedule \ + pass(c,a,b,7) \ + key_schedule \ + pass(b,c,a,9) \ + for(pass_no=3; pass_no<PASSES; pass_no++) { \ + key_schedule \ + pass(a,b,c,9) \ + tmpa=a; a=c; c=b; b=tmpa;} \ + feedforward +#else +#define compress \ + save_abc \ for(pass_no=0; pass_no<PASSES; pass_no++) { \ if(pass_no != 0) {key_schedule} \ pass(a,b,c,(pass_no==0?5:pass_no==1?7:9)); \ tmpa=a; a=c; c=b; b=tmpa;} \ feedforward +#endif #define tiger_compress_macro(str, state) \ { \ @@ -114,6 +155,10 @@ void TigerHash::update(const void* data, size_t length) { size_t tmppos = (u_int32_t)(pos & BLOCK_SIZE-1); +#ifdef TIGER_BIG_ENDIAN + u_int8_t buf[BLOCK_SIZE]; + int j; +#endif const u_int8_t* str = (const u_int8_t*)data; // First empty tmp buffer if possible if(tmppos > 0) { @@ -124,7 +169,13 @@ length -= n; if((tmppos + n) == BLOCK_SIZE) { - tigerCompress((u_int64_t*)tmp, res); +#ifdef TIGER_BIG_ENDIAN + for(j=0; j<BLOCK_SIZE; j++) + buf[j^7]=((u_int8_t*)tmp)[j]; + tiger_compress_macro(((u_int64_t*)buf), res); +#else + tiger_compress_macro(((u_int64_t*)tmp), res); +#endif tmppos = 0; } } @@ -134,7 +185,13 @@ // Process the bulk of data while(length>=BLOCK_SIZE) { - tigerCompress((u_int64_t*)str, res); +#ifdef TIGER_BIG_ENDIAN + for(j=0; j<BLOCK_SIZE; j++) + buf[j^7]=((u_int8_t*)str)[j]; + tiger_compress_macro(((u_int64_t*)buf), res); +#else + tiger_compress_macro(((u_int64_t*)str), res); +#endif str += BLOCK_SIZE; pos += BLOCK_SIZE; length -= BLOCK_SIZE; @@ -147,6 +204,10 @@ u_int8_t* TigerHash::finalize() { size_t tmppos = (size_t)(pos & BLOCK_SIZE-1); +#ifdef TIGER_BIG_ENDIAN + u_int8_t buf[BLOCK_SIZE]; + int j; +#endif // Tmp buffer always has at least one pos, otherwise it would have // been processed in update() @@ -154,14 +215,30 @@ if(tmppos > (BLOCK_SIZE - sizeof(u_int64_t))) { memset(tmp + tmppos, 0, BLOCK_SIZE - tmppos); - tigerCompress(((u_int64_t*)tmp), res); +#ifdef TIGER_BIG_ENDIAN + for(j=0; j<BLOCK_SIZE; j++) + buf[j^7]=((u_int8_t*)tmp)[j]; + tiger_compress_macro(((u_int64_t*)buf), res); +#else + tiger_compress_macro(((u_int64_t*)tmp), res); +#endif memset(tmp, 0, BLOCK_SIZE); } else { memset(tmp + tmppos, 0, BLOCK_SIZE - tmppos - sizeof(u_int64_t)); +#ifdef TIGER_BIG_ENDIAN + for(j=0; j<BLOCK_SIZE; j++) + buf[j^7]=((u_int8_t*)tmp)[j]; + memcpy(tmp, buf, BLOCK_SIZE); +#endif } ((u_int64_t*)(&(tmp[56])))[0] = pos<<3; - tigerCompress((u_int64_t*)tmp, res); + tiger_compress_macro(((u_int64_t*)tmp), res); +#ifdef TIGER_BIG_ENDIAN + for(j=0; j<HASH_SIZE; j++) + buf[j^7]=((u_int8_t*)res)[j]; + memcpy(res, buf, HASH_SIZE); +#endif return getResult(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2006-06-17 15:41:25
|
Revision: 616 Author: arnetheduck Date: 2006-06-17 08:40:35 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=616&view=rev Log Message: ----------- Patches Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/ConnectionManager.cpp dcplusplus/trunk/client/ConnectionManager.h dcplusplus/trunk/client/HashManager.cpp dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/SearchManager.cpp dcplusplus/trunk/client/SearchManager.h dcplusplus/trunk/client/SettingsManager.cpp dcplusplus/trunk/client/SettingsManager.h dcplusplus/trunk/windows/ADLSProperties.cpp dcplusplus/trunk/windows/ADLSProperties.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/SpyFrame.cpp dcplusplus/trunk/windows/SpyFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/changelog.txt 2006-06-17 15:40:35 UTC (rev 616) @@ -8,7 +8,14 @@ * [bug 944] Fixed unix string conversion bug (thanks tobias nygren) * [bug 945] Fixed unix mutex initialiser (thanks tobias nygren) * [bug 946] Tiger hash supports big endian and 64-bit architectures (thanks tobias nygren) +* [bug 941] Updated usercount display (thanks pothead) +* [bug 951] Fixed issue with high port numbers (thanks tpo) +* [bug 958] Search spy tth option automagically saved (thanks ullner) +* [bug 959] Code cleanup (thanks pothead) +* [bug 966] Max hash speed fixed when fast hashing method is not used (thanks steven sheehy) +* [bug 967] Fixed path case-sensitivity issue (thanks steven sheehy) + -- 0.691 2006-06-03 -- * Links to bugzilla in html changelog * [bug 122] Added userlist filter (thanks trem) Modified: dcplusplus/trunk/client/ConnectionManager.cpp =================================================================== --- dcplusplus/trunk/client/ConnectionManager.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/ConnectionManager.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -43,12 +43,12 @@ } // @todo clean this up void ConnectionManager::listen() throw(Exception){ - short lastPort = (short)SETTING(TCP_PORT); + unsigned short lastPort = (unsigned short)SETTING(TCP_PORT); if(lastPort == 0) - lastPort = (short)Util::rand(1025, 32000); + lastPort = (unsigned short)Util::rand(1025, 32000); - short firstPort = lastPort; + unsigned short firstPort = lastPort; disconnect(); Modified: dcplusplus/trunk/client/ConnectionManager.h =================================================================== --- dcplusplus/trunk/client/ConnectionManager.h 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/ConnectionManager.h 2006-06-17 15:40:35 UTC (rev 616) @@ -138,8 +138,8 @@ friend class Server; CriticalSection cs; - short port; - short securePort; + unsigned short port; + unsigned short securePort; /** All ConnectionQueueItems */ ConnectionQueueItem::List downloads; Modified: dcplusplus/trunk/client/HashManager.cpp =================================================================== --- dcplusplus/trunk/client/HashManager.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/HashManager.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -624,6 +624,9 @@ if(lastRead + minTime > now) { Thread::sleep(minTime - (now - lastRead)); } + lastRead = lastRead + minTime; + } else { + lastRead = GET_TICK(); } n = f.read(buf, bufSize); tth->update(buf, n); Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -37,12 +37,6 @@ #include <limits> -#ifdef _WIN32 -#define FILELISTS_DIR "FileLists\\" -#else -#define FILELISTS_DIR "filelists/" -#endif - #ifdef ff #undef ff #endif @@ -330,7 +324,7 @@ SearchManager::getInstance()->addListener(this); ClientManager::getInstance()->addListener(this); - File::ensureDirectory(Util::getConfigPath() + FILELISTS_DIR); + File::ensureDirectory(Util::getListPath()); } QueueManager::~QueueManager() throw() { @@ -341,7 +335,7 @@ saveQueue(); if(!BOOLSETTING(KEEP_LISTS)) { - string path = Util::getConfigPath() + FILELISTS_DIR; + string path = Util::getListPath(); #ifdef _WIN32 WIN32_FIND_DATA data; @@ -420,7 +414,7 @@ } void QueueManager::addList(const User::Ptr& aUser, int aFlags) throw(QueueException, FileException) { - string target = Util::getConfigPath() + FILELISTS_DIR + Util::validateFileName(aUser->getFirstNick()) + "." + aUser->getCID().toBase32(); + string target = Util::getListPath() + Util::validateFileName(aUser->getFirstNick()) + "." + aUser->getCID().toBase32(); add(target, -1, NULL, aUser, USER_LIST_NAME, true, QueueItem::FLAG_USER_LIST | aFlags); } Modified: dcplusplus/trunk/client/SearchManager.cpp =================================================================== --- dcplusplus/trunk/client/SearchManager.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/SearchManager.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -103,12 +103,12 @@ } void SearchManager::listen() throw(Exception) { - short lastPort = (short)SETTING(UDP_PORT); + unsigned short lastPort = (unsigned short)SETTING(UDP_PORT); if(lastPort == 0) - lastPort = (short)Util::rand(1025, 32000); + lastPort = (unsigned short)Util::rand(1025, 32000); - short firstPort = lastPort; + unsigned short firstPort = lastPort; disconnect(); Modified: dcplusplus/trunk/client/SearchManager.h =================================================================== --- dcplusplus/trunk/client/SearchManager.h 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/SearchManager.h 2006-06-17 15:40:35 UTC (rev 616) @@ -143,7 +143,7 @@ void respond(const AdcCommand& cmd, const CID& cid); - short getPort() + unsigned short getPort() { return port; } @@ -167,7 +167,7 @@ private: Socket* socket; - short port; + unsigned short port; bool stop; u_int32_t lastSearch; friend class Singleton<SearchManager>; Modified: dcplusplus/trunk/client/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/client/SettingsManager.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/SettingsManager.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -73,7 +73,7 @@ "NoIpOverride", "SearchOnlyFreeSlots", "LastSearchType", "BoldFinishedDownloads", "BoldFinishedUploads", "BoldQueue", "BoldHub", "BoldPm", "BoldSearch", "SocketInBuffer", "SocketOutBuffer", "OnlyDlTthFiles", "OpenWaitingUsers", "BoldWaitingUsers", "OpenSystemLog", "BoldSystemLog", "AutoRefreshTime", - "UseSsl", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "PromptPassword", + "UseSsl", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "PromptPassword", "SpyFrameIgnoreTthSearches", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -257,6 +257,7 @@ setDefault(ALT_SORT_ORDER, false); setDefault(AUTO_KICK_NO_FAVS, false); setDefault(PROMPT_PASSWORD, false); + setDefault(SPY_FRAME_IGNORE_TTH_SEARCHES, false); #ifdef _WIN32 setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); Modified: dcplusplus/trunk/client/SettingsManager.h =================================================================== --- dcplusplus/trunk/client/SettingsManager.h 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/client/SettingsManager.h 2006-06-17 15:40:35 UTC (rev 616) @@ -89,7 +89,7 @@ NO_IP_OVERRIDE, SEARCH_ONLY_FREE_SLOTS, LAST_SEARCH_TYPE, BOLD_FINISHED_DOWNLOADS, BOLD_FINISHED_UPLOADS, BOLD_QUEUE, BOLD_HUB, BOLD_PM, BOLD_SEARCH, SOCKET_IN_BUFFER, SOCKET_OUT_BUFFER, ONLY_DL_TTH_FILES, OPEN_WAITING_USERS, BOLD_WAITING_USERS, OPEN_SYSTEM_LOG, BOLD_SYSTEM_LOG, AUTO_REFRESH_TIME, - USE_SSL, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, + USE_SSL, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, SPY_FRAME_IGNORE_TTH_SEARCHES, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/windows/ADLSProperties.cpp =================================================================== --- dcplusplus/trunk/windows/ADLSProperties.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/windows/ADLSProperties.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -26,8 +26,7 @@ #include "WinUtil.h" // Initialize dialog -LRESULT ADLSProperties::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) -{ +LRESULT ADLSProperties::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) { // Translate the texts SetWindowText(CTSTRING(ADLS_PROPERTIES)); SetDlgItemText(IDC_ADLSP_SEARCH, CTSTRING(ADLS_SEARCH_STRING)); @@ -39,32 +38,34 @@ SetDlgItemText(IDC_IS_ACTIVE, CTSTRING(ADLS_ENABLED)); SetDlgItemText(IDC_AUTOQUEUE, CTSTRING(ADLS_DOWNLOAD)); - // Initialize combo boxes - ::SendMessage(GetDlgItem(IDC_SOURCE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SourceTypeToDisplayString(ADLSearch::OnlyFile).c_str()); - ::SendMessage(GetDlgItem(IDC_SOURCE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SourceTypeToDisplayString(ADLSearch::OnlyDirectory).c_str()); - ::SendMessage(GetDlgItem(IDC_SOURCE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SourceTypeToDisplayString(ADLSearch::FullPath).c_str()); + // Initialize dialog items + ctrlSearch.Attach(GetDlgItem(IDC_SEARCH_STRING)); + ctrlDestDir.Attach(GetDlgItem(IDC_DEST_DIR)); + ctrlMinSize.Attach(GetDlgItem(IDC_MIN_FILE_SIZE)); + ctrlMaxSize.Attach(GetDlgItem(IDC_MAX_FILE_SIZE)); + ctrlActive.Attach(GetDlgItem(IDC_IS_ACTIVE)); + ctrlAutoQueue.Attach(GetDlgItem(IDC_AUTOQUEUE)); - ::SendMessage(GetDlgItem(IDC_SIZE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SizeTypeToDisplayString(ADLSearch::SizeBytes).c_str()); - ::SendMessage(GetDlgItem(IDC_SIZE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SizeTypeToDisplayString(ADLSearch::SizeKibiBytes).c_str()); - ::SendMessage(GetDlgItem(IDC_SIZE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SizeTypeToDisplayString(ADLSearch::SizeMebiBytes).c_str()); - ::SendMessage(GetDlgItem(IDC_SIZE_TYPE), CB_ADDSTRING, 0, - (LPARAM)search->SizeTypeToDisplayString(ADLSearch::SizeGibiBytes).c_str()); + ctrlSearchType.Attach(GetDlgItem(IDC_SOURCE_TYPE)); + ctrlSearchType.AddString(CTSTRING(FILENAME)); + ctrlSearchType.AddString(CTSTRING(DIRECTORY)); + ctrlSearchType.AddString(CTSTRING(ADLS_FULL_PATH)); + ctrlSizeType.Attach(GetDlgItem(IDC_SIZE_TYPE)); + ctrlSizeType.AddString(CTSTRING(B)); + ctrlSizeType.AddString(CTSTRING(KiB)); + ctrlSizeType.AddString(CTSTRING(MiB)); + ctrlSizeType.AddString(CTSTRING(GiB)); + // Load search data - SetDlgItemText(IDC_SEARCH_STRING, Text::toT(search->searchString).c_str()); - SetDlgItemText(IDC_DEST_DIR, Text::toT(search->destDir).c_str()); - SetDlgItemText(IDC_MIN_FILE_SIZE, Text::toT(search->minFileSize > 0 ? Util::toString(search->minFileSize) : "").c_str()); - SetDlgItemText(IDC_MAX_FILE_SIZE, Text::toT(search->maxFileSize > 0 ? Util::toString(search->maxFileSize) : "").c_str()); - ::SendMessage(GetDlgItem(IDC_IS_ACTIVE), BM_SETCHECK, search->isActive ? 1 : 0, 0L); - ::SendMessage(GetDlgItem(IDC_SOURCE_TYPE), CB_SETCURSEL, search->sourceType, 0L); - ::SendMessage(GetDlgItem(IDC_SIZE_TYPE), CB_SETCURSEL, search->typeFileSize, 0L); - ::SendMessage(GetDlgItem(IDC_AUTOQUEUE), BM_SETCHECK, search->isAutoQueue ? 1 : 0, 0L); + ctrlSearch.SetWindowText(Text::toT(search->searchString).c_str()); + ctrlDestDir.SetWindowText(Text::toT(search->destDir).c_str()); + ctrlMinSize.SetWindowText(Text::toT(search->minFileSize > 0 ? Util::toString(search->minFileSize) : "").c_str()); + ctrlMaxSize.SetWindowText(Text::toT(search->maxFileSize > 0 ? Util::toString(search->maxFileSize) : "").c_str()); + ctrlActive.SetCheck(search->isActive ? 1 : 0); + ctrlAutoQueue.SetCheck(search->isAutoQueue ? 1 : 0); + ctrlSearchType.SetCurSel(search->sourceType); + ctrlSizeType.SetCurSel(search->typeFileSize); // Center dialog CenterWindow(GetParent()); @@ -75,25 +76,25 @@ // Exit dialog LRESULT ADLSProperties::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - if(wID == IDOK) - { + if(wID == IDOK) { // Update search TCHAR buf[256]; - GetDlgItemText(IDC_SEARCH_STRING, buf, 256); + ctrlSearch.GetWindowText(buf, 256); search->searchString = Text::fromT(buf); - GetDlgItemText(IDC_DEST_DIR, buf, 256); + ctrlDestDir.GetWindowText(buf, 256); search->destDir = Text::fromT(buf); - GetDlgItemText(IDC_MIN_FILE_SIZE, buf, 256); + ctrlMinSize.GetWindowText(buf, 256); search->minFileSize = (_tcslen(buf) == 0 ? -1 : Util::toInt64(Text::fromT(buf))); - GetDlgItemText(IDC_MAX_FILE_SIZE, buf, 256); + ctrlMaxSize.GetWindowText(buf, 256); search->maxFileSize = (_tcslen(buf) == 0 ? -1 : Util::toInt64(Text::fromT(buf))); - search->sourceType = (ADLSearch::SourceType)::SendMessage(GetDlgItem(IDC_SOURCE_TYPE), CB_GETCURSEL, 0, 0L); - search->typeFileSize = (ADLSearch::SizeType)::SendMessage(GetDlgItem(IDC_SIZE_TYPE), CB_GETCURSEL, 0, 0L); - search->isActive = (::SendMessage(GetDlgItem(IDC_IS_ACTIVE), BM_GETCHECK, 0, 0L) != 0); - search->isAutoQueue = (::SendMessage(GetDlgItem(IDC_AUTOQUEUE), BM_GETCHECK, 0, 0L) != 0); + search->isActive = (ctrlActive.GetCheck() == 1); + search->isAutoQueue = (ctrlAutoQueue.GetCheck() == 1); + + search->sourceType = (ADLSearch::SourceType)ctrlSearchType.GetCurSel(); + search->typeFileSize = (ADLSearch::SizeType)ctrlSizeType.GetCurSel(); } EndDialog(wID); Modified: dcplusplus/trunk/windows/ADLSProperties.h =================================================================== --- dcplusplus/trunk/windows/ADLSProperties.h 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/windows/ADLSProperties.h 2006-06-17 15:40:35 UTC (rev 616) @@ -56,6 +56,15 @@ // Current search ADLSearch* search; + + CEdit ctrlSearch; + CEdit ctrlDestDir; + CEdit ctrlMinSize; + CEdit ctrlMaxSize; + CButton ctrlActive; + CButton ctrlAutoQueue; + CComboBox ctrlSearchType; + CComboBox ctrlSizeType; }; #endif // !defined(ADLS_PROPERTIES_H) Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -357,7 +357,7 @@ string nicks; while( (i = ctrlUsers.GetNextItem(i, LVNI_SELECTED)) != -1) { - nicks += (ctrlUsers.getItemData(i))->getIdentity().getNick(); + nicks += ctrlUsers.getItemData(i)->getNick(); nicks += ' '; } if(!nicks.empty()) { @@ -382,7 +382,7 @@ if(i == userMap.end()) { UserInfo* ui = new UserInfo(u); userMap.insert(make_pair(u.user, ui)); - if(!ui->getIdentity().isHidden() && showUsers) + if(!ui->isHidden() && showUsers) ctrlUsers.insertItem(ui, getImage(u.identity)); if(!filter.empty()) @@ -391,7 +391,7 @@ return true; } else { UserInfo* ui = i->second; - if(!ui->getIdentity().isHidden() && u.identity.isHidden() && showUsers) { + if(!ui->isHidden() && u.identity.isHidden() && showUsers) { ctrlUsers.deleteItem(ui); } @@ -419,7 +419,7 @@ } UserInfo* ui = i->second; - if(!ui->getIdentity().isHidden() && showUsers) + if(!ui->isHidden() && showUsers) ctrlUsers.deleteItem(ui); userMap.erase(i); @@ -500,8 +500,7 @@ } else if(task->speaker == SET_WINDOW_TITLE) { SetWindowText(static_cast<StringTask*>(task)->msg.c_str()); } else if(task->speaker == STATS) { - ctrlStatus.SetText(1, Text::toT(Util::toString(showUsers ? ctrlUsers.GetItemCount() : getUserCount()) + - "/" + Util::toString(getUserCount()) + " " + STRING(HUB_USERS)).c_str()); + ctrlStatus.SetText(1, Text::toT(getUsersTextForStatusBar()).c_str()); ctrlStatus.SetText(2, Text::toT(Util::formatBytes(getAvailable())).c_str()); } else if(task->speaker == GET_PASSWORD) { if(client->getPassword().size() > 0) { @@ -1090,7 +1089,7 @@ for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i) { UserInfo* ui = i->second; - if(!ui->getIdentity().isHidden()) + if(!ui->isHidden()) ctrlUsers.insertItem(ui, getImage(ui->getIdentity())); } @@ -1308,8 +1307,8 @@ } bool HubFrame::parseFilter(FilterModes& mode, int64_t& size) { - tstring::size_type start = tstring::npos; - tstring::size_type end = tstring::npos; + tstring::size_type start = static_cast<tstring::size_type>(tstring::npos); + tstring::size_type end = static_cast<tstring::size_type>(tstring::npos); int64_t multiplier = 1; if(filter.compare(0, 2, _T(">=")) == 0) { @@ -1360,7 +1359,6 @@ multiplier = 1; } - if(end == tstring::npos) { end = filter.length(); } @@ -1383,6 +1381,9 @@ //avoid refreshing the whole list and just update the current item //instead if(ui != NULL) { + if(ui->isHidden()) { + return; + } if(filter.empty()) { if(ctrlUsers.findItem(ui) == -1) { ctrlUsers.insertItem(ui, getImage(ui->getIdentity())); @@ -1404,15 +1405,14 @@ if(filter.empty()) { for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i){ - if(i->second != NULL) + UserInfo* ui = i->second; + if(!ui->isHidden()) ctrlUsers.insertItem(i->second, getImage(i->second->getIdentity())); } } else { for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i){ - if( i->second != NULL ) { - if(matchFilter(*i->second, sel, doSizeCompare, mode, size)) { - ctrlUsers.insertItem(i->second, getImage(i->second->getIdentity())); - } + if(!ui->isHidden() && matchFilter(*i->second, sel, doSizeCompare, mode, size)) { + ctrlUsers.insertItem(i->second, getImage(i->second->getIdentity())); } } } @@ -1482,3 +1482,18 @@ return insert; } +string HubFrame::getUsersTextForStatusBar() const { + size_t userCount = 0; + for(UserMap::const_iterator i = userMap.begin(); i != userMap.end(); ++i){ + UserInfo* ui = i->second; + if(!ui->isHidden()) + userCount++; + } + + string textForUsers; + if (ctrlUsers.GetSelectedCount() > 1) + textForUsers += Util::toString(ctrlUsers.GetSelectedCount()) + "/"; + if (showUsers && (size_t)ctrlUsers.GetItemCount() < userCount) + textForUsers += Util::toString(ctrlUsers.GetItemCount()) + "/"; + return textForUsers + Util::toString(userCount) + " " + STRING(HUB_USERS); +} Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/windows/HubFrame.h 2006-06-17 15:40:35 UTC (rev 616) @@ -240,6 +240,9 @@ bool update(const Identity& identity, int sortCol); + const string& getNick() const { return identity.getNick(); } + bool isHidden() const { return identity.isHidden(); } + tstring columns[COLUMN_LAST]; GETSET(Identity, identity, Identity); }; @@ -302,10 +305,7 @@ } }; - size_t getUserCount() const { - size_t sel = ctrlUsers.GetSelectedCount(); - return sel > 1 ? sel : userMap.size(); - } + string getUsersTextForStatusBar() const; int64_t getAvailable() { if (ctrlUsers.GetSelectedCount() > 1) { Modified: dcplusplus/trunk/windows/SpyFrame.cpp =================================================================== --- dcplusplus/trunk/windows/SpyFrame.cpp 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/windows/SpyFrame.cpp 2006-06-17 15:40:35 UTC (rev 616) @@ -46,7 +46,7 @@ ctrlIgnoreTth.Create(ctrlStatus.m_hWnd, rcDefault, CTSTRING(IGNORE_TTH_SEARCHES), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); ctrlIgnoreTth.SetButtonStyle(BS_AUTOCHECKBOX, false); ctrlIgnoreTth.SetFont(WinUtil::systemFont); - ctrlIgnoreTth.SetCheck(false); + ctrlIgnoreTth.SetCheck(ignoreTth); ignoreTthContainer.SubclassWindow(ctrlIgnoreTth.m_hWnd); WinUtil::splitTokens(columnIndexes, SETTING(SPYFRAME_ORDER), COLUMN_LAST); @@ -75,6 +75,8 @@ return 0; } else { WinUtil::saveHeaderOrder(ctrlSearches, SettingsManager::SPYFRAME_ORDER, SettingsManager::SPYFRAME_WIDTHS, COLUMN_LAST, columnIndexes, columnSizes); + if (ignoreTth != BOOLSETTING(SPY_FRAME_IGNORE_TTH_SEARCHES)) + SettingsManager::getInstance()->set(SettingsManager::SPY_FRAME_IGNORE_TTH_SEARCHES, ignoreTth); bHandled = FALSE; return 0; Modified: dcplusplus/trunk/windows/SpyFrame.h =================================================================== --- dcplusplus/trunk/windows/SpyFrame.h 2006-06-13 20:03:56 UTC (rev 615) +++ dcplusplus/trunk/windows/SpyFrame.h 2006-06-17 15:40:35 UTC (rev 616) @@ -35,7 +35,7 @@ private ClientManagerListener, private TimerManagerListener { public: - SpyFrame() : total(0), cur(0), closed(false), ignoreTth(false), ignoreTthContainer(WC_BUTTON, this, IGNORETTH_MESSAGE_MAP) { + SpyFrame() : total(0), cur(0), closed(false), ignoreTth(BOOLSETTING(SPY_FRAME_IGNORE_TTH_SEARCHES)), ignoreTthContainer(WC_BUTTON, this, IGNORETTH_MESSAGE_MAP) { ZeroMemory(perSecond, sizeof(perSecond)); ClientManager::getInstance()->addListener(this); TimerManager::getInstance()->addListener(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |