1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-04 10:38:13 +00:00

add messages asking the user to check & make sure that port forwarding is enabled on their router

This commit is contained in:
Charles Kerr 2007-12-15 05:28:16 +00:00
parent 20c5f2a77c
commit fe0640caa7
2 changed files with 10 additions and 6 deletions

View file

@ -130,6 +130,7 @@ tr_natpmpPulse( struct tr_natpmp * nat, int port, int isEnabled )
tr_inf( KEY "found public address %s", inet_ntoa( response.publicaddress.addr ) ); tr_inf( KEY "found public address %s", inet_ntoa( response.publicaddress.addr ) );
nat->state = TR_NATPMP_IDLE; nat->state = TR_NATPMP_IDLE;
} else if( val != NATPMP_TRYAGAIN ) { } else if( val != NATPMP_TRYAGAIN ) {
tr_err( KEY "If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" );
nat->state = TR_NATPMP_ERR; nat->state = TR_NATPMP_ERR;
} }
} }
@ -159,6 +160,7 @@ tr_natpmpPulse( struct tr_natpmp * nat, int port, int isEnabled )
nat->port = -1; nat->port = -1;
nat->isMapped = 0; nat->isMapped = 0;
} else if( val != NATPMP_TRYAGAIN ) { } else if( val != NATPMP_TRYAGAIN ) {
tr_err( KEY "If your router supports NAT-PMP, please make sure NAT-PMP is enabled!" );
nat->state = TR_NATPMP_ERR; nat->state = TR_NATPMP_ERR;
} }
} }

View file

@ -93,13 +93,14 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
} }
errno = 0; errno = 0;
if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) { if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) {
tr_inf( KEY "found Internet Gateway Device '%s'", handle->urls.controlURL ); tr_inf( KEY "Found Internet Gateway Device '%s'", handle->urls.controlURL );
tr_inf( KEY "local LAN IP Address is '%s'", handle->lanaddr ); tr_inf( KEY "Local LAN IP Address is '%s'", handle->lanaddr );
handle->state = TR_UPNP_IDLE; handle->state = TR_UPNP_IDLE;
handle->hasDiscovered = 1; handle->hasDiscovered = 1;
} else { } else {
handle->state = TR_UPNP_ERR; handle->state = TR_UPNP_ERR;
tr_err( KEY "UPNP_GetValidIGD failed. (errno %d - %s)", errno, strerror(errno) ); tr_err( KEY "UPNP_GetValidIGD failed. (errno %d - %s)", errno, strerror(errno) );
tr_err( KEY "If your router supports UPnP, please make sure UPnP is enabled!" );
} }
freeUPNPDevlist( devlist ); freeUPNPDevlist( devlist );
} }
@ -117,7 +118,7 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
UPNP_DeletePortMapping( handle->urls.controlURL, UPNP_DeletePortMapping( handle->urls.controlURL,
handle->data.servicetype, handle->data.servicetype,
portStr, "TCP" ); portStr, "TCP" );
tr_dbg( KEY "stopping port forwarding of '%s', service '%s'", tr_dbg( KEY "Stopping port forwarding of '%s', service '%s'",
handle->urls.controlURL, handle->data.servicetype ); handle->urls.controlURL, handle->data.servicetype );
handle->isMapped = 0; handle->isMapped = 0;
handle->state = TR_UPNP_IDLE; handle->state = TR_UPNP_IDLE;
@ -141,14 +142,15 @@ tr_upnpPulse( tr_upnp * handle, int port, int isEnabled )
handle->data.servicetype, handle->data.servicetype,
portStr, portStr, handle->lanaddr, portStr, portStr, handle->lanaddr,
"Transmission", "TCP" ) ); "Transmission", "TCP" ) );
tr_inf( KEY "port forwarding via '%s', service '%s'. (local address: %s:%d)", tr_inf( KEY "Port forwarding via '%s', service '%s'. (local address: %s:%d)",
handle->urls.controlURL, handle->data.servicetype, handle->lanaddr, port ); handle->urls.controlURL, handle->data.servicetype, handle->lanaddr, port );
if( handle->isMapped ) { if( handle->isMapped ) {
tr_inf( KEY "port forwarding successful!" ); tr_inf( KEY "Port forwarding successful!" );
handle->port = port; handle->port = port;
handle->state = TR_UPNP_IDLE; handle->state = TR_UPNP_IDLE;
} else { } else {
tr_err( KEY "port forwarding failed (errno %d - %s)", errno, strerror(errno) ); tr_err( KEY "Port forwarding failed (errno %d - %s)", errno, strerror(errno) );
tr_err( KEY "If your router supports UPnP, please make sure UPnP is enabled!" );
handle->port = -1; handle->port = -1;
handle->state = TR_UPNP_ERR; handle->state = TR_UPNP_ERR;
} }