linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #01904
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2239: More verbose UPnP error logs; fix lambda compilation issue with GCC
------------------------------------------------------------
revno: 2239
committer: eMTee <emtee11@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Thu 2010-09-09 20:16:26 +0200
message:
More verbose UPnP error logs; fix lambda compilation issue with GCC
modified:
dcpp/UPnP.h
dcpp/UPnPManager.cpp
win32/HubFrame.cpp
win32/UPnP_COM.cpp
win32/UPnP_COM.h
win32/UPnP_MiniUPnPc.cpp
win32/UPnP_MiniUPnPc.h
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/UPnP.h'
--- dcpp/UPnP.h 2010-06-18 12:09:55 +0000
+++ dcpp/UPnP.h 2010-09-09 18:16:26 +0000
@@ -39,6 +39,7 @@
bool close();
virtual string getExternalIP() = 0;
+ virtual const string& getName() const = 0;
protected:
static const char* protocols[PROTOCOL_LAST];
=== modified file 'dcpp/UPnPManager.cpp'
--- dcpp/UPnPManager.cpp 2010-09-01 15:07:18 +0000
+++ dcpp/UPnPManager.cpp 2010-09-09 18:16:26 +0000
@@ -64,27 +64,35 @@
conn_port = ConnectionManager::getInstance()->getPort(),
secure_port = ConnectionManager::getInstance()->getSecurePort(),
search_port = SearchManager::getInstance()->getPort();
-
+
for(Impls::iterator i = impls.begin(); i != impls.end(); ++i) {
UPnP& impl = *i;
close(impl);
- if(!impl.init())
- continue;
-
- if(conn_port != 0 && !impl.open(conn_port, UPnP::PROTOCOL_TCP, str(F_(APPNAME " Transfer Port (%1% TCP)") % conn_port)))
- continue;
-
- if(secure_port != 0 && !impl.open(secure_port, UPnP::PROTOCOL_TCP, str(F_(APPNAME " Encrypted Transfer Port (%1% TCP)") % secure_port)))
- continue;
-
- if(search_port != 0 && !impl.open(search_port, UPnP::PROTOCOL_UDP, str(F_(APPNAME " Search Port (%1% UDP)") % search_port)))
- continue;
+ if(!impl.init()) {
+ log(str(F_("Failed to initalize the %1% interface") % impl.getName()));
+ continue;
+ }
+
+ if(conn_port != 0 && !impl.open(conn_port, UPnP::PROTOCOL_TCP, str(F_(APPNAME " Transfer Port (%1% TCP)") % conn_port))) {
+ log(str(F_("The %1% interface has failed to map the %2% %3% port") % impl.getName() % "TCP" % conn_port));
+ continue;
+ }
+
+ if(secure_port != 0 && !impl.open(secure_port, UPnP::PROTOCOL_TCP, str(F_(APPNAME " Encrypted Transfer Port (%1% TCP)") % secure_port))) {
+ log(str(F_("The %1% interface has failed to map the %2% %3% port") % impl.getName() % "TLS" % secure_port));
+ continue;
+ }
+
+ if(search_port != 0 && !impl.open(search_port, UPnP::PROTOCOL_UDP, str(F_(APPNAME " Search Port (%1% UDP)") % search_port))) {
+ log(str(F_("The %1% interface has failed to map the %2% %3% port") % impl.getName() % "UDP" % search_port));
+ continue;
+ }
opened = true;
- log(str(F_("Successfully created port mappings. TCP: %1%, UDP: %2%, TLS: %3%") % conn_port % search_port % secure_port));
+ log(str(F_("Successfully created port mappings (TCP: %1%, UDP: %2%, TLS: %3%), mapped using the %4% interface") % conn_port % search_port % secure_port % impl.getName()));
ConnectivityManager::getInstance()->mappingFinished(true);
if(!BOOLSETTING(NO_IP_OVERRIDE)) {
=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp 2010-09-08 15:32:07 +0000
+++ win32/HubFrame.cpp 2010-09-09 18:16:26 +0000
@@ -745,7 +745,7 @@
void HubFrame::on(Connecting, Client*) throw() {
tstring hubUrl = Text::toT(client->getHubUrl());
callAsync([this, hubUrl]() { addStatus(boost::str(TF_("Connecting to %1%...") % hubUrl), true); });
- callAsync([this, hubUrl]() { setText(hubUrl); });
+ callAsync([this, hubUrl]() { this->setText(hubUrl); });
}
void HubFrame::on(Connected, Client*) throw() {
callAsync(std::bind(&HubFrame::onConnected, this));
@@ -799,7 +799,7 @@
}
#endif
tstring hubNameT = Text::toT(hubName);
- callAsync([this, hubNameT]() { setText(hubNameT); });
+ callAsync([this, hubNameT]() { this->setText(hubNameT); });
}
void HubFrame::on(Message, Client*, const ChatMessage& message) throw() {
=== modified file 'win32/UPnP_COM.cpp'
--- win32/UPnP_COM.cpp 2010-06-18 12:09:55 +0000
+++ win32/UPnP_COM.cpp 2010-09-09 18:16:26 +0000
@@ -25,6 +25,8 @@
#include <ole2.h>
+const string UPnP_COM::name = "Standard Windows";
+
bool UPnP_COM::init() {
// Lacking the __uuidof in mingw...
CLSID upnp;
=== modified file 'win32/UPnP_COM.h'
--- win32/UPnP_COM.h 2010-06-18 12:09:55 +0000
+++ win32/UPnP_COM.h 2010-09-09 18:16:26 +0000
@@ -38,8 +38,12 @@
bool add(const unsigned short port, const Protocol protocol, const string& description);
bool remove(const unsigned short port, const Protocol protocol);
+ const string& getName() const {
+ return name;
+ }
string getExternalIP();
+ static const string name;
IUPnPNAT* pUN;
// this one can become invalidated so we can't cache it
=== modified file 'win32/UPnP_MiniUPnPc.cpp'
--- win32/UPnP_MiniUPnPc.cpp 2010-06-18 12:09:55 +0000
+++ win32/UPnP_MiniUPnPc.cpp 2010-09-09 18:16:26 +0000
@@ -31,6 +31,7 @@
static UPNPUrls urls;
static IGDdatas data;
+const string UPnP_MiniUPnPc::name = "MiniUPnP";
bool UPnP_MiniUPnPc::init() {
UPNPDev* devices = upnpDiscover(2000, 0, 0, 0);
=== modified file 'win32/UPnP_MiniUPnPc.h'
--- win32/UPnP_MiniUPnPc.h 2010-06-18 12:09:55 +0000
+++ win32/UPnP_MiniUPnPc.h 2010-09-09 18:16:26 +0000
@@ -31,8 +31,12 @@
bool add(const unsigned short port, const Protocol protocol, const string& description);
bool remove(const unsigned short port, const Protocol protocol);
+ const string& getName() const {
+ return name;
+ }
string getExternalIP();
+ static const string name;
};
#endif