fix one cause of slow shutdown: even if we weren't using natpmp, we would wait on it...

This commit is contained in:
Charles Kerr 2008-04-01 19:52:21 +00:00
parent 5890eaef34
commit 9c93ac23b0
2 changed files with 3 additions and 5 deletions

View File

@ -86,9 +86,6 @@ void
tr_natpmpClose( tr_natpmp * nat )
{
assert( !nat->isMapped );
assert( ( nat->state == TR_NATPMP_IDLE )
|| ( nat->state == TR_NATPMP_ERR )
|| ( nat->state == TR_NATPMP_DISCOVER ) );
closenatpmp( &nat->natpmp );
tr_free( nat );

View File

@ -157,13 +157,14 @@ sharedPulse( void * vshared )
{
incomingPeersPulse( shared );
}
else if( ( shared->natStatus == TR_NAT_TRAVERSAL_ERROR ) || ( shared->natStatus == TR_NAT_TRAVERSAL_UNMAPPED ) )
else
{
tr_ninf( getKey(), _( "Stopped" ) );
shared->h->shared = NULL;
tr_timerFree( &shared->pulseTimer );
tr_netClose( shared->bindSocket );
tr_natpmpClose( shared->natpmp );
tr_upnpClose( shared->upnp );
shared->h->shared = NULL;
tr_free( shared );
keepPulsing = 0;
}