mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
(trunk libT) #2745 "Crash with tr_sessionSetPortForwardingEnabled()" -- fixed in trunk for 1.90
This commit is contained in:
parent
e305a68d7b
commit
95a4adfd22
1 changed files with 20 additions and 7 deletions
|
@ -1727,15 +1727,28 @@ tr_sessionIsLazyBitfieldEnabled( const tr_session * session )
|
|||
****
|
||||
***/
|
||||
|
||||
void
|
||||
tr_sessionSetPortForwardingEnabled( tr_session * session,
|
||||
tr_bool enabled )
|
||||
struct port_forwarding_data
|
||||
{
|
||||
assert( tr_isSession( session ) );
|
||||
tr_bool enabled;
|
||||
struct tr_shared * shared;
|
||||
};
|
||||
|
||||
tr_sessionLock( session );
|
||||
tr_sharedTraversalEnable( session->shared, enabled );
|
||||
tr_sessionUnlock( session );
|
||||
static void
|
||||
setPortForwardingEnabled( void * vdata )
|
||||
{
|
||||
struct port_forwarding_data * data = vdata;
|
||||
tr_sharedTraversalEnable( data->shared, data->enabled );
|
||||
tr_free( data );
|
||||
}
|
||||
|
||||
void
|
||||
tr_sessionSetPortForwardingEnabled( tr_session * session, tr_bool enabled )
|
||||
{
|
||||
struct port_forwarding_data * d;
|
||||
d = tr_new0( struct port_forwarding_data, 1 );
|
||||
d->shared = session->shared;
|
||||
d->enabled = enabled;
|
||||
tr_runInEventThread( session, setPortForwardingEnabled, d );
|
||||
}
|
||||
|
||||
tr_bool
|
||||
|
|
Loading…
Reference in a new issue