Changeset 1868 for trunk/libtransmission/torrent.c
- Timestamp:
- May 11, 2007, 6:56:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r1829 r1868 239 239 } 240 240 241 void tr_torrentStart( tr_torrent_t * tor ) 242 { 243 char name[32]; 241 int tr_torrentDuplicateDownload( tr_torrent_t * tor ) 242 { 244 243 tr_torrent_t * current, * next; 245 244 246 if( tor->status & ( TR_STATUS_STOPPING | TR_STATUS_STOPPED ) ) 247 { 248 /* Join the thread first */ 249 torrentReallyStop( tor ); 250 } 251 252 /* Don't start if a torrent with the same name and destination is already active */ 245 /* Check if a torrent with the same name and destination is already active */ 253 246 for( current = tor->handle->torrentList; current; current = current->next ) 254 247 { … … 257 250 && !strcmp( tor->info.name, current->info.name ) ) 258 251 { 259 tor->error = TR_ERROR_IO_DUP_NAME; 260 snprintf( tor->errorString, sizeof( tor->errorString ), 261 "%s", tr_errorString( TR_ERROR_IO_DUP_NAME ) ); 262 return; 263 } 252 return 1; 253 } 254 } 255 return 0; 256 } 257 258 void tr_torrentStart( tr_torrent_t * tor ) 259 { 260 char name[32]; 261 262 if( tor->status & ( TR_STATUS_STOPPING | TR_STATUS_STOPPED ) ) 263 { 264 /* Join the thread first */ 265 torrentReallyStop( tor ); 266 } 267 268 /* Don't start if a torrent with the same name and destination is already active */ 269 if( tr_torrentDuplicateDownload( tor ) ) 270 { 271 tor->error = TR_ERROR_IO_DUP_DOWNLOAD; 272 snprintf( tor->errorString, sizeof( tor->errorString ), 273 "%s", tr_errorString( TR_ERROR_IO_DUP_DOWNLOAD ) ); 274 return; 264 275 } 265 276
Note: See TracChangeset
for help on using the changeset viewer.