Changeset 3927


Ignore:
Timestamp:
Nov 22, 2007, 6:13:56 AM (15 years ago)
Author:
charles
Message:

fix portmapping crash.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9x/libtransmission/transmission.c

    r3897 r3927  
    180180 *
    181181 **********************************************************************/
    182 void tr_setBindPort( tr_handle * h, int port )
    183 {
    184     h->isPortSet = 1;
    185     tr_sharedSetPort( h->shared, port );
     182
     183struct bind_port_data
     184{
     185    tr_handle * handle;
     186    int port;
     187};
     188
     189static void
     190tr_setBindPortImpl( void * vdata )
     191{
     192    struct bind_port_data * data = vdata;
     193    tr_handle * handle = data->handle;
     194    const int port = data->port;
     195
     196    handle->isPortSet = 1;
     197    tr_sharedSetPort( handle->shared, port );
     198
     199    tr_free( data );
     200}
     201
     202void
     203tr_setBindPort( tr_handle * handle, int port )
     204{
     205    struct bind_port_data * data = tr_new( struct bind_port_data, 1 );
     206    data->handle = handle;
     207    data->port = port;
     208    tr_runInEventThread( handle, tr_setBindPortImpl, data );
    186209}
    187210
Note: See TracChangeset for help on using the changeset viewer.