mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +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
|
struct port_forwarding_data
|
||||||
tr_sessionSetPortForwardingEnabled( tr_session * session,
|
|
||||||
tr_bool enabled )
|
|
||||||
{
|
{
|
||||||
assert( tr_isSession( session ) );
|
tr_bool enabled;
|
||||||
|
struct tr_shared * shared;
|
||||||
|
};
|
||||||
|
|
||||||
tr_sessionLock( session );
|
static void
|
||||||
tr_sharedTraversalEnable( session->shared, enabled );
|
setPortForwardingEnabled( void * vdata )
|
||||||
tr_sessionUnlock( session );
|
{
|
||||||
|
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
|
tr_bool
|
||||||
|
|
Loading…
Reference in a new issue