From 13b03ba1952801b89995e9c1bb676f70a59f6ade Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 11 Feb 2010 14:28:40 +0000 Subject: [PATCH] (trunk libT) #2892 "changing port number doesn't actually change until program restart" -- possible fix --- libtransmission/port-forwarding.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libtransmission/port-forwarding.c b/libtransmission/port-forwarding.c index a8ee9d341..1fadc9a62 100644 --- a/libtransmission/port-forwarding.c +++ b/libtransmission/port-forwarding.c @@ -175,10 +175,15 @@ stop_forwarding( tr_shared * s ) { tr_ninf( getKey( ), "%s", _( "Stopped" ) ); natPulse( s, FALSE ); + tr_natpmpClose( s->natpmp ); s->natpmp = NULL; + s->natpmpStatus = TR_PORT_UNMAPPED; + tr_upnpClose( s->upnp ); s->upnp = NULL; + s->upnpStatus = TR_PORT_UNMAPPED; + stop_timer( s ); } @@ -217,7 +222,7 @@ tr_sharedPortChanged( tr_session * session ) if( s->isEnabled ) { - stop_timer( s ); + stop_forwarding( s ); start_timer( s ); } }