From ae40410b4e5c9a8069a27af7fc7e34a8dbff2741 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 28 Jun 2007 00:09:59 +0000 Subject: [PATCH] Fix tr_getComplete() and tr_getDone() bug reported by BentMyWookie --- libtransmission/torrent.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 7014b9700..9f53da0c0 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1024,11 +1024,13 @@ torrentThreadLoop ( void * _tor ) tr_torrentWriterLock( tor ); cpStatus = tr_cpGetStatus( tor->completion ); if( cpStatus != tor->cpStatus ) { - tor->hasChangedState = tor->cpStatus = cpStatus; + tor->cpStatus = cpStatus; if( (cpStatus == TR_CP_COMPLETE) /* if we're complete */ && 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 */ + tor->hasChangedState = tor->cpStatus; /* and the client */ + } tr_ioSync( tor->io ); } tr_torrentWriterUnlock( tor );