(trunk libT) #3117 "Tracker queries to not honor bind-address-ipv4" -- fix a crash-on-shutdown reported by Waldorf in #3181. The crash was introduced by r10535 for #3117

This commit is contained in:
Charles Kerr 2010-04-30 17:38:40 +00:00
parent 24129b9bf5
commit 5eab3318ff
1 changed files with 7 additions and 3 deletions

View File

@ -214,12 +214,16 @@ open_incoming_peer_port( tr_session * session )
const tr_address*
tr_sessionGetPublicAddress( const tr_session * session, int tr_af_type )
{
const struct tr_bindinfo * bindinfo;
switch( tr_af_type )
{
case TR_AF_INET: return &session->public_ipv4->addr;
case TR_AF_INET6: return &session->public_ipv6->addr; break;
default: return NULL;
case TR_AF_INET: bindinfo = session->public_ipv4; break;
case TR_AF_INET6: bindinfo = session->public_ipv6; break;
default: bindinfo = NULL; break;
}
return bindinfo ? &bindinfo->addr : NULL;
}
/***