1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

Fix tr_getComplete() and tr_getDone() bug reported by BentMyWookie

This commit is contained in:
Charles Kerr 2007-06-28 00:09:59 +00:00
parent 995c1cdbb1
commit ae40410b4e

View file

@ -1024,11 +1024,13 @@ torrentThreadLoop ( void * _tor )
tr_torrentWriterLock( tor ); tr_torrentWriterLock( tor );
cpStatus = tr_cpGetStatus( tor->completion ); cpStatus = tr_cpGetStatus( tor->completion );
if( cpStatus != tor->cpStatus ) { if( cpStatus != tor->cpStatus ) {
tor->hasChangedState = tor->cpStatus = cpStatus; tor->cpStatus = cpStatus;
if( (cpStatus == TR_CP_COMPLETE) /* if we're complete */ if( (cpStatus == TR_CP_COMPLETE) /* if we're complete */
&& tor->tracker!=NULL /* and we have a tracker */ && tor->tracker!=NULL /* and we have a tracker */
&& tor->downloadedCur ) /* and it just happened */ && tor->downloadedCur ) { /* and it just happened */
tr_trackerCompleted( tor->tracker ); /* tell the tracker */ tr_trackerCompleted( tor->tracker ); /* tell the tracker */
tor->hasChangedState = tor->cpStatus; /* and the client */
}
tr_ioSync( tor->io ); tr_ioSync( tor->io );
} }
tr_torrentWriterUnlock( tor ); tr_torrentWriterUnlock( tor );