I will not commit without compiling first.
I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first. I will not commit without compiling first.
This commit is contained in:
parent
3ea2daa3bc
commit
794bd1a801
|
@ -85,7 +85,7 @@ tr_handle_t * tr_init()
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
void tr_setBindPort( tr_handle_t * h, int port )
|
void tr_setBindPort( tr_handle_t * h, int port )
|
||||||
{
|
{
|
||||||
int sock;
|
int sock = -1;
|
||||||
tr_torrent_t * tor;
|
tr_torrent_t * tor;
|
||||||
|
|
||||||
if( h->bindPort == port )
|
if( h->bindPort == port )
|
||||||
|
@ -252,6 +252,11 @@ tr_torrent_t * tr_torrentInit( tr_handle_t * h, const char * path,
|
||||||
(h->torrentCount)++;
|
(h->torrentCount)++;
|
||||||
tr_lockUnlock( &h->acceptLock );
|
tr_lockUnlock( &h->acceptLock );
|
||||||
|
|
||||||
|
if( 0 > h->bindPort )
|
||||||
|
{
|
||||||
|
tr_setBindPort( h, TR_DEFAULT_PORT );
|
||||||
|
}
|
||||||
|
|
||||||
return tor;
|
return tor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,11 +294,6 @@ void tr_torrentStart( tr_torrent_t * tor )
|
||||||
tor->status = TR_STATUS_CHECK;
|
tor->status = TR_STATUS_CHECK;
|
||||||
tor->tracker = tr_trackerInit( tor );
|
tor->tracker = tr_trackerInit( tor );
|
||||||
|
|
||||||
if( 0 > h->bindPort )
|
|
||||||
{
|
|
||||||
tr_setBindPort( h, TR_DEFAULT_PORT );
|
|
||||||
}
|
|
||||||
|
|
||||||
tor->date = tr_date();
|
tor->date = tr_date();
|
||||||
tor->die = 0;
|
tor->die = 0;
|
||||||
tr_threadCreate( &tor->thread, downloadLoop, tor );
|
tr_threadCreate( &tor->thread, downloadLoop, tor );
|
||||||
|
|
Loading…
Reference in New Issue