Update of /cvsroot/btplusplus/BT++/src
In directory sc8-pr-cvs1:/tmp/cvs-serv32068/src
Modified Files:
LoaderManager.py ConfigFile.py
Log Message:
- Added strict hashing config option.
- Fixed upload limit updating (after pref change).
Index: LoaderManager.py
===================================================================
RCS file: /cvsroot/btplusplus/BT++/src/LoaderManager.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** LoaderManager.py 29 Mar 2003 00:54:13 -0000 1.11
--- LoaderManager.py 29 Mar 2003 15:31:54 -0000 1.12
***************
*** 99,102 ****
--- 99,108 ----
return self.Loaders[num]
+ def SetUpSpeed(self, speed):
+ for l in self.Loaders:
+ if l.Obj.has_key('Connecter'):
+ con = l.Obj['Connecter']
+ con.max_upload_rate = speed * 1024
+
###########################################################################################################
###########################################################################################################
***************
*** 221,232 ****
dwsta = Config.Get('Download', 'AutoStart')
dwmax = Config.Get('Download', 'MaxSimDown')
if dwsta == 1 and dwcnt < dwmax:
dwcnt = dwmax - dwcnt
for loader in self.Loaders:
if dwcnt <= 0:
break
! if not loader.IsRunning() and not loader.IsUserPaused() and not loader.IsFinished():
dwcnt = dwcnt - 1
loader.StartDownload()
--- 227,247 ----
dwsta = Config.Get('Download', 'AutoStart')
dwmax = Config.Get('Download', 'MaxSimDown')
+
+ hscnt = self.GetNumHashing()
+ hsmax = Config.Get('Hash', 'NumSimHash')
+ hsstr = Config.Get('Hash', 'Strict')
if dwsta == 1 and dwcnt < dwmax:
dwcnt = dwmax - dwcnt
+ hscnt = hsmax - hscnt
for loader in self.Loaders:
if dwcnt <= 0:
break
! if not loader.IsRunning() \
! and not loader.IsUserPaused() \
! and not loader.IsFinished() \
! and (hsstr == 0 or hscnt < hsmax):
! hscnt = hscnt - 1
dwcnt = dwcnt - 1
loader.StartDownload()
Index: ConfigFile.py
===================================================================
RCS file: /cvsroot/btplusplus/BT++/src/ConfigFile.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ConfigFile.py 28 Mar 2003 12:44:25 -0000 1.6
--- ConfigFile.py 29 Mar 2003 15:31:54 -0000 1.7
***************
*** 18,22 ****
'Hash': {
'Background': 1,
! 'NumSimHash': 1
},
'Bind': {
--- 18,23 ----
'Hash': {
'Background': 1,
! 'NumSimHash': 1,
! 'Strict': 0
},
'Bind': {
|