mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
Thread safety improvements. Also, stopping/starting/rechecking/etc. torrents no longer blocks the calling thread. Since this a big commit, it will probably create some short-term pain via new bugs.
This commit is contained in:
@@ -154,7 +154,7 @@ int main( int argc, char ** argv )
|
||||
}
|
||||
|
||||
/* Open and parse torrent file */
|
||||
if( !( tor = tr_torrentInit( h, torrentPath, NULL, 0, &error ) ) )
|
||||
if( !( tor = tr_torrentInit( h, torrentPath, ".", NULL, 0, &error ) ) )
|
||||
{
|
||||
printf( "Failed opening torrent file `%s'\n", torrentPath );
|
||||
tr_close( h );
|
||||
@@ -227,7 +227,6 @@ int main( int argc, char ** argv )
|
||||
|
||||
tr_natTraversalEnable( h, natTraversal );
|
||||
|
||||
tr_torrentSetFolder( tor, "." );
|
||||
tr_torrentStart( tor );
|
||||
|
||||
for( ;; )
|
||||
@@ -246,11 +245,7 @@ int main( int argc, char ** argv )
|
||||
|
||||
s = tr_torrentStat( tor );
|
||||
|
||||
if( s->status & TR_STATUS_PAUSE )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if( s->status & TR_STATUS_CHECK_WAIT )
|
||||
if( s->status & TR_STATUS_CHECK_WAIT )
|
||||
{
|
||||
chars = snprintf( string, sizeof string,
|
||||
"Waiting to check files... %.2f %%", 100.0 * s->percentDone );
|
||||
|
||||
Reference in New Issue
Block a user