1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 09:04:33 +02:00

* Properly detect the correct UPnP InternetGateway device.

This commit is contained in:
Christian Muehlhaeuser
2013-02-14 19:10:59 +01:00
parent b6361abdd7
commit 78e0475b9e

View File

@@ -25,6 +25,7 @@
#include <winsock2.h> #include <winsock2.h>
#endif #endif
Portfwd::Portfwd() Portfwd::Portfwd()
: m_urls( 0 ) : m_urls( 0 )
, m_data( 0 ) , m_data( 0 )
@@ -93,7 +94,7 @@ Portfwd::init( unsigned int timeout )
continue; continue;
} }
if ( strstr( dev->st, "InternetGatewayDevice" ) ) if ( strstr( dev->descURL, "InternetGatewayDevice" ) )
break; break;
dev = dev->pNext; dev = dev->pNext;
@@ -101,7 +102,7 @@ Portfwd::init( unsigned int timeout )
if ( !dev ) if ( !dev )
dev = devlist; /* defaulting to first device */ dev = devlist; /* defaulting to first device */
printf( "UPnP device :\n" printf( "UPnP device:\n"
" desc: %s\n st: %s\n", " desc: %s\n st: %s\n",
dev->descURL, dev->st ); dev->descURL, dev->st );
@@ -165,6 +166,7 @@ Portfwd::add( unsigned short port, unsigned short internal_port )
{ {
char port_str[16], port_str_internal[16]; char port_str[16], port_str_internal[16];
int r; int r;
printf( "Portfwd::add (%s, %d)\n", m_lanip.c_str(), port ); printf( "Portfwd::add (%s, %d)\n", m_lanip.c_str(), port );
if ( m_urls->controlURL[0] == '\0' ) if ( m_urls->controlURL[0] == '\0' )
{ {
@@ -190,6 +192,7 @@ bool
Portfwd::remove( unsigned short port ) Portfwd::remove( unsigned short port )
{ {
char port_str[16]; char port_str[16];
printf( "Portfwd::remove(%d)\n", port ); printf( "Portfwd::remove(%d)\n", port );
if ( m_urls->controlURL[0] == '\0' ) if ( m_urls->controlURL[0] == '\0' )
{ {