Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === modified file 'dcpp/Util.cpp'
- --- dcpp/Util.cpp 2011-01-29 14:15:43 +0000
- +++ dcpp/Util.cpp 2011-02-11 17:41:50 +0000
- @@ -460,7 +460,7 @@
- fileStart = authorityEnd;
- }
- - protocol = url.substr(protoStart, protoEnd - protoStart);
- + protocol = protocol = (protoEnd == string::npos ? Util::emptyString : url.substr(protoStart, protoEnd - protoStart));
- if(authorityEnd > authorityStart) {
- dcdebug("x");
- @@ -499,7 +499,7 @@
- port = 80;
- } else if(protocol == "https") {
- port = 443;
- - } else if(protocol == "dchub") {
- + } else if(protocol == "dchub" || protocol.empty()) {
- port = 411;
- }
- } else {
- === modified file 'win32/WinUtil.cpp'
- --- win32/WinUtil.cpp 2011-02-01 21:05:24 +0000
- +++ win32/WinUtil.cpp 2011-02-11 18:01:38 +0000
- @@ -1163,35 +1163,30 @@
- bool WinUtil::parseDBLClick(const tstring& str) {
- auto url = Text::fromT(str);
- string proto, host, file, query, fragment;
- - uint16_t port = 411;
- + uint16_t port;
- Util::decodeUrl(url, proto, host, port, file, query, fragment);
- if(Util::stricmp(proto.c_str(), "adc") == 0 ||
- Util::stricmp(proto.c_str(), "adcs") == 0 ||
- - Util::stricmp(proto.c_str(), "dchub") == 0 ||
- - proto.empty())
- + Util::stricmp(proto.c_str(), "dchub") == 0 )
- {
- - if(host == "magnet") {
- - parseMagnetUri(str);
- - } else {
- - if(!host.empty()) {
- - HubFrame::openWindow(mainWindow->getTabView(), url);
- + if(!host.empty()) {
- + HubFrame::openWindow(mainWindow->getTabView(), url);
- + }
- +
- + if(!file.empty()) {
- + if(file[0] == '/') {
- + // Remove any '/' in from of the file
- + file = file.substr(1);
- + if(file.empty()) return true;
- }
- -
- - if(!file.empty()) {
- - if(file[0] == '/') {
- - // Remove any '/' in from of the file
- - file = file.substr(1);
- - if(file.empty()) return true;
- - }
- - try {
- - UserPtr user = ClientManager::getInstance()->findLegacyUser(file);
- - if(user)
- - QueueManager::getInstance()->addList(HintedUser(user, url), QueueItem::FLAG_CLIENT_VIEW);
- - // @todo else report error
- - } catch (const Exception&) {
- - // ...
- - }
- + try {
- + UserPtr user = ClientManager::getInstance()->findLegacyUser(file);
- + if(user)
- + QueueManager::getInstance()->addList(HintedUser(user, url), QueueItem::FLAG_CLIENT_VIEW);
- + // @todo else report error
- + } catch (const Exception&) {
- + // ...
- }
- }
- @@ -1201,6 +1196,9 @@
- Util::strnicmp(str.c_str(), _T("mailto:"), 7) == 0) {
- openLink(str);
- return true;
- + } else if(host == "magnet") {
- + parseMagnetUri(str);
- + return true;
- }
- return false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement