1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(trunk libT) #1996: Regression: Crash on shutdown when IPv6 is unavailable

This commit is contained in:
Charles Kerr 2009-04-17 16:49:56 +00:00
parent f00043998d
commit 452fd21d15

View file

@ -308,6 +308,9 @@ const tr_socketList * tr_getSessionBindSockets( const tr_session * session );
void void
tr_sessionGetSettings( tr_session * s, struct tr_benc * d ) tr_sessionGetSettings( tr_session * s, struct tr_benc * d )
{ {
const char * val;
const tr_address * addr;
assert( tr_bencIsDict( d ) ); assert( tr_bencIsDict( d ) );
tr_bencDictReserve( d, 30 ); tr_bencDictReserve( d, 30 );
@ -356,10 +359,14 @@ tr_sessionGetSettings( tr_session * s, struct tr_benc * d )
tr_bencDictAddInt ( d, TR_PREFS_KEY_USPEED, tr_sessionGetSpeedLimit( s, TR_UP ) ); tr_bencDictAddInt ( d, TR_PREFS_KEY_USPEED, tr_sessionGetSpeedLimit( s, TR_UP ) );
tr_bencDictAddBool( d, TR_PREFS_KEY_USPEED_ENABLED, tr_sessionIsSpeedLimited( s, TR_UP ) ); tr_bencDictAddBool( d, TR_PREFS_KEY_USPEED_ENABLED, tr_sessionIsSpeedLimited( s, TR_UP ) );
tr_bencDictAddInt ( d, TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT, s->uploadSlotsPerTorrent ); tr_bencDictAddInt ( d, TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT, s->uploadSlotsPerTorrent );
tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV4,
tr_ntop_non_ts( tr_socketListGetType( tr_getSessionBindSockets( s ), TR_AF_INET ) ) ); addr = tr_socketListGetType( tr_getSessionBindSockets( s ), TR_AF_INET );
tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV6, val = addr ? tr_ntop_non_ts( addr ) : TR_DEFAULT_BIND_ADDRESS_IPV4;
tr_ntop_non_ts( tr_socketListGetType( tr_getSessionBindSockets( s ), TR_AF_INET6 ) ) ); tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV4, val );
addr = tr_socketListGetType( tr_getSessionBindSockets( s ), TR_AF_INET6 );
val = addr ? tr_ntop_non_ts( addr ) : TR_DEFAULT_BIND_ADDRESS_IPV6;
tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV6, val );
} }
void void