StrongDC++

Fórum programu StrongDC++
It is currently October 23rd, 2014, 6:08 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: UPnP and TLS port
PostPosted: October 12th, 2008, 11:40 pm 
Offline
Lame user

Joined: October 12th, 2008, 11:33 pm
Posts: 2
Hi, I'm using StrongDC++ 2.21 with UPnP port forwarding feature.
I've noted, that TLS port is not being forwarder in my router, only TCP and UDP port being opened automatically there (i can confirm this by GUI in WinXP and in router logs). The result is predictable - if i check boxes "Use TLS when remote client supports it" and two other checkboxes at the same place - i'm failing to download even file listings from clients that has TLS set up. Expected behaviour, CAUSE tls port is NOT redirected. But should be, as I suppose. Is this a bug, or I've missed smth.?

PS. If i UNCHECK checkboxes concerned, everything is fine :)


Top
 Profile  
 
 Post subject: Re: UPnP and TLS port
PostPosted: October 14th, 2008, 12:27 am 
Offline
Lame user

Joined: October 12th, 2008, 11:33 pm
Posts: 2
Now can confirm exactly I'm positively right: downloaded sourcecode and found no UPnP redirection of TLS port ;-)

MainFrm.cpp:

void MainFrame::startUPnP() {
stopUPnP();

if( SETTING(INCOMING_CONNECTIONS) == SettingsManager::INCOMING_FIREWALL_UPNP ) {
UPnP_TCPConnection = new UPnP( Util::getLocalIp(), "TCP", APPNAME " Download Port (" + Util::toString(ConnectionManager::getInstance()->getPort()) + " TCP)", ConnectionManager::getInstance()->getPort() );
UPnP_UDPConnection = new UPnP( Util::getLocalIp(), "UDP", APPNAME " Search Port (" + Util::toString(SearchManager::getInstance()->getPort()) + " UDP)", SearchManager::getInstance()->getPort() );

// <--------- here must be TLS redirection set also -------->
//Smth. like this:


if(CryptoManager::getInstance()->TLSOk())
{
UPnP_TCPTLSConnection = new UPnP(Util::getLocalIp(), "TCP", APPNAME " TLS Port (" + Util::toString(ConnectionManager::getInstance()->getSecurePort()) + " TCP)", ConnectionManager::getInstance()->getSecurePort() );

}

if ( FAILED(UPnP_UDPConnection->OpenPorts()) || FAILED(UPnP_TCPConnection->OpenPorts()) || (FAILED(UPnP_TCPTLSConnection->OpenPorts()) && CryptoManager::getInstance()->TLSOk()))
{
LogManager::getInstance()->message(STRING(UPNP_FAILED_TO_CREATE_MAPPINGS));
MessageBox(CTSTRING(UPNP_FAILED_TO_CREATE_MAPPINGS), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_OK | MB_ICONWARNING);

// We failed! thus reset the objects
delete UPnP_TCPConnection;
delete UPnP_UDPConnection;
delete UPnP_TCPTLSConnection;
UPnP_TCPConnection = UPnP_UDPConnection = UPnP_TCPTLSConnection=NULL;
}
else
{
if(!BOOLSETTING(NO_IP_OVERRIDE)) {
// now lets configure the external IP (connect to me) address
string ExternalIP = UPnP_TCPConnection->GetExternalIP();
if ( !ExternalIP.empty() ) {
// woohoo, we got the external IP from the UPnP framework
SettingsManager::getInstance()->set(SettingsManager::EXTERNAL_IP, ExternalIP );
} else {
//:-( Looks like we have to rely on the user setting the external IP manually
// no need to do cleanup here because the mappings work
LogManager::getInstance()->message(STRING(UPNP_FAILED_TO_GET_EXTERNAL_IP));
MessageBox(CTSTRING(UPNP_FAILED_TO_GET_EXTERNAL_IP), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_OK | MB_ICONWARNING);
}
}
}
}
}

void MainFrame::stopUPnP() {
// Just check if the port mapping objects are initialized (NOT NULL)
if ( UPnP_TCPConnection != NULL )
{
if (FAILED(UPnP_TCPConnection->ClosePorts()) )
{
LogManager::getInstance()->message(STRING(UPNP_FAILED_TO_REMOVE_MAPPINGS));
}
delete UPnP_TCPConnection;
}
if ( UPnP_UDPConnection != NULL )
{
if (FAILED(UPnP_UDPConnection->ClosePorts()) )
{
LogManager::getInstance()->message(STRING(UPNP_FAILED_TO_REMOVE_MAPPINGS));
}
delete UPnP_UDPConnection;
}

if ( UPnP_TCPTLSConnection != NULL )
{
if (FAILED(UPnP_TCPTLSConnection->ClosePorts()) )
{
LogManager::getInstance()->message(STRING(UPNP_FAILED_TO_REMOVE_MAPPINGS));
}
delete UPnP_TCPTLSConnection;
}

// Not sure this is required (i.e. Objects are checked later in execution)
// But its better being on the save side :P
UPnP_TCPConnection = UPnP_UDPConnection = UPnP_TCPTLSConnection = NULL;
}


Top
 Profile  
 
 Post subject: Re: UPnP and TLS port
PostPosted: October 14th, 2008, 11:25 pm 
Offline
Betatester
User avatar

Joined: September 24th, 2008, 10:42 am
Posts: 49
Location: HU
This problem is fixed in DC++ recently so probably it'll make its way to the next StrongDC++ release...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group