make the Port Forwarding error messages a little easier for beginners to understand

This commit is contained in:
Charles Kerr 2008-03-18 02:15:19 +00:00
parent e92a0938ab
commit 3d232f4db0
3 changed files with 12 additions and 10 deletions

View File

@ -69,7 +69,7 @@ logVal( const char * func, int ret )
else if( ret >= 0 )
tr_ndbg( getKey(), _( "%s succeeded (%d)" ), func, ret );
else
tr_nerr( getKey(), _( "%s failed (%d): %s (%d)" ), func, ret, tr_strerror(errno), errno );
tr_ndbg( getKey(), _( "%s failed (%d): %s (%d)" ), func, ret, tr_strerror(errno), errno );
}
struct tr_natpmp*
@ -109,8 +109,8 @@ setCommandTime( struct tr_natpmp * nat )
static void
setErrorState( struct tr_natpmp * nat )
{
tr_nerr( getKey(), _( "If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" ) );
tr_nerr( getKey(), _( "NAT-PMP port forwarding unsuccessful, trying UPnP next" ) );
tr_ndbg( getKey(), _( "If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" ) );
tr_ndbg( getKey(), _( "NAT-PMP port forwarding unsuccessful, trying UPnP next" ) );
nat->state = TR_NATPMP_ERR;
}

View File

@ -95,6 +95,8 @@ natPulse( tr_shared * s )
if( status != s->natStatus ) {
tr_ninf( getKey(), _( "State changed from \"%s\" to \"%s\"" ), getNatStateStr(s->natStatus), getNatStateStr(status) );
s->natStatus = status;
if( status == TR_NAT_TRAVERSAL_ERROR )
tr_nerr( getKey(), _( "Port forwarding failed. See debug messages for more information." ) );
}
}

View File

@ -88,18 +88,18 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
errno = 0;
devlist = upnpDiscover( 2000, NULL, NULL );
if( devlist == NULL ) {
tr_nerr( getKey(), _( "upnpDiscover failed (errno %d - %s)" ), errno, tr_strerror(errno) );
tr_ndbg( getKey(), _( "upnpDiscover failed (errno %d - %s)" ), errno, tr_strerror(errno) );
}
errno = 0;
if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) {
tr_ninf( getKey(), _( "Found Internet Gateway Device \"%s\"" ), handle->urls.controlURL );
tr_ninf( getKey(), _( "Local Address is \"%s\"" ), handle->lanaddr );
tr_ndbg( getKey(), _( "Found Internet Gateway Device \"%s\"" ), handle->urls.controlURL );
tr_ndbg( getKey(), _( "Local Address is \"%s\"" ), handle->lanaddr );
handle->state = TR_UPNP_IDLE;
handle->hasDiscovered = 1;
} else {
handle->state = TR_UPNP_ERR;
tr_nerr( getKey(), _( "UPNP_GetValidIGD failed (errno %d - %s)" ), errno, tr_strerror(errno) );
tr_nerr( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
tr_ndbg( getKey(), _( "UPNP_GetValidIGD failed (errno %d - %s)" ), errno, tr_strerror(errno) );
tr_ndbg( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
}
freeUPNPDevlist( devlist );
}
@ -153,8 +153,8 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
handle->port = port;
handle->state = TR_UPNP_IDLE;
} else {
tr_nerr( getKey(), _( "Port forwarding failed with error %d (%d - %s)" ), err, errno, tr_strerror(errno) );
tr_nerr( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
tr_ndbg( getKey(), _( "Port forwarding failed with error %d (%d - %s)" ), err, errno, tr_strerror(errno) );
tr_ndbg( getKey(), _( "If your router supports UPnP, please make sure UPnP is enabled!" ) );
handle->port = -1;
handle->state = TR_UPNP_ERR;
}