Changeset 2423
- Timestamp:
- Jul 19, 2007, 3:48:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r2388 r2423 983 983 984 984 static void 985 recheckCpState( tr_torrent_t * tor ) 986 { 987 cp_status_t cpStatus; 988 989 tr_torrentWriterLock( tor ); 990 991 cpStatus = tr_cpGetStatus( tor->completion ); 992 if( cpStatus != tor->cpStatus ) { 993 tor->cpStatus = cpStatus; 994 tor->hasChangedState = tor->cpStatus; /* tell the client... */ 995 if( (cpStatus == TR_CP_COMPLETE) /* ...and if we're complete */ 996 && tor->tracker!=NULL /* and we have a tracker */ 997 && tor->downloadedCur ) { /* and it just happened */ 998 tr_trackerCompleted( tor->tracker ); /* tell the tracker */ 999 } 1000 tr_ioSync( tor->io ); 1001 } 1002 tr_torrentWriterUnlock( tor ); 1003 } 1004 1005 static void 985 1006 torrentThreadLoop ( void * _tor ) 986 1007 { … … 998 1019 while( ! ( tor->dieFlag && (tor->runStatus == TR_RUN_STOPPED) ) ) 999 1020 { 1000 cp_status_t cpStatus;1001 1002 1021 /* sleep a little while */ 1003 1022 tr_wait( tor->runStatus == TR_RUN_STOPPED ? 1600 : 600 ); 1004 1023 1005 if( tor->fastResumeDirty ) { 1024 if( tor->fastResumeDirty ) 1025 { 1006 1026 tor->fastResumeDirty = FALSE; 1007 1027 fastResumeSave( tor ); 1028 recheckCpState( tor ); 1008 1029 } 1009 1030 … … 1109 1130 1110 1131 /* refresh our completion state */ 1111 tr_torrentWriterLock( tor ); 1112 cpStatus = tr_cpGetStatus( tor->completion ); 1113 if( cpStatus != tor->cpStatus ) { 1114 tor->cpStatus = cpStatus; 1115 tor->hasChangedState = tor->cpStatus; /* tell the client... */ 1116 if( (cpStatus == TR_CP_COMPLETE) /* ...and if we're complete */ 1117 && tor->tracker!=NULL /* and we have a tracker */ 1118 && tor->downloadedCur ) { /* and it just happened */ 1119 tr_trackerCompleted( tor->tracker ); /* tell the tracker */ 1120 } 1121 tr_ioSync( tor->io ); 1122 } 1123 tr_torrentWriterUnlock( tor ); 1132 recheckCpState( tor ); 1124 1133 1125 1134 /* ping the tracker... */
Note: See TracChangeset
for help on using the changeset viewer.