cvs diff: Diffing . Index: btlaunchmany.py =================================================================== RCS file: /opt/src/cvsroot/bittorrent/btlaunchmany.py,v retrieving revision 1.1.1.3.4.1 retrieving revision 1.1.1.3.4.2 diff -c -r1.1.1.3.4.1 -r1.1.1.3.4.2 *** btlaunchmany.py 15 Apr 2004 17:45:35 -0000 1.1.1.3.4.1 --- btlaunchmany.py 11 Aug 2004 15:53:22 -0000 1.1.1.3.4.2 *************** *** 11,16 **** --- 11,19 ---- from BitTorrent import RawServer RawServer.listen_thread=RawServer._listen_thread() + from BitTorrent import Connecter,CurrentRateMeasure + Connecter.Measure_Total=CurrentRateMeasure.Measure_Total(30) + from BitTorrent.download import download from threading import Thread, Event, Lock Index: btlaunchmanycurses.py =================================================================== RCS file: /opt/src/cvsroot/bittorrent/btlaunchmanycurses.py,v retrieving revision 1.1.1.2.4.1 retrieving revision 1.1.1.2.4.2 diff -c -r1.1.1.2.4.1 -r1.1.1.2.4.2 *** btlaunchmanycurses.py 15 Apr 2004 11:41:33 -0000 1.1.1.2.4.1 --- btlaunchmanycurses.py 8 Jul 2004 17:17:02 -0000 1.1.1.2.4.2 *************** *** 11,16 **** --- 11,20 ---- from BitTorrent import RawServer RawServer.listen_thread=RawServer._listen_thread() + from BitTorrent import Connecter,CurrentRateMeasure + Connecter.Measure_Total=CurrentRateMeasure.Measure_Total(30) + + from BitTorrent.download import download from threading import Thread, Event, Lock cvs diff: Diffing BitTorrent Index: BitTorrent/Connecter.py =================================================================== RCS file: /opt/src/cvsroot/bittorrent/BitTorrent/Connecter.py,v retrieving revision 1.1.1.11 retrieving revision 1.1.1.11.2.3 diff -c -r1.1.1.11 -r1.1.1.11.2.3 *** BitTorrent/Connecter.py 13 Apr 2004 02:22:07 -0000 1.1.1.11 --- BitTorrent/Connecter.py 8 Jul 2004 17:34:07 -0000 1.1.1.11.2.3 *************** *** 5,10 **** --- 5,12 ---- from binascii import b2a_hex from CurrentRateMeasure import Measure + Measure_Total=None + def toint(s): return long(b2a_hex(s), 16) *************** *** 100,113 **** self.totalup = totalup self.rate_capped = False self.connections = {} def _update_upload_rate(self, amount): self.totalup.update_rate(amount) ! if self.max_upload_rate > 0 and self.totalup.get_rate_noupdate() > self.max_upload_rate: self.rate_capped = True ! self.sched(self._uncap, self.totalup.time_until_rate(self.max_upload_rate)) def _uncap(self): self.rate_capped = False while not self.rate_capped: up = None --- 102,128 ---- self.totalup = totalup self.rate_capped = False self.connections = {} + self.rate_Total=self.totalup + if Measure_Total : + self.rate_Total=Measure_Total def _update_upload_rate(self, amount): self.totalup.update_rate(amount) ! if Measure_Total : ! Measure_Total.update_rate(amount) ! ! if self.max_upload_rate > 0 and self.rate_Total.get_rate_noupdate() > self.max_upload_rate: self.rate_capped = True ! self.sched(self._uncap, self.rate_Total.time_until_rate(self.max_upload_rate)) def _uncap(self): + if Measure_Total : + Measure_Total.get_rate() + if self.max_upload_rate > 0 and self.rate_Total.get_rate_noupdate() > self.max_upload_rate: + self.rate_capped = True + self.sched(self._uncap, self.rate_Total.time_until_rate(self.max_upload_rate)) + return + self.rate_capped = False while not self.rate_capped: up = None Index: BitTorrent/CurrentRateMeasure.py =================================================================== RCS file: /opt/src/cvsroot/bittorrent/BitTorrent/CurrentRateMeasure.py,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.4.2.1 diff -c -r1.1.1.4 -r1.1.1.4.2.1 *** BitTorrent/CurrentRateMeasure.py 13 Apr 2004 02:22:07 -0000 1.1.1.4 --- BitTorrent/CurrentRateMeasure.py 8 Jul 2004 17:17:02 -0000 1.1.1.4.2.1 *************** *** 35,37 **** --- 35,52 ---- def get_total(self): return self.total + + class Measure_Total(Measure) : + def __init__(self, max_rate_period, fudge = 1): + Measure.__init__(self, max_rate_period, fudge) + import threading + self.lock=threading.Lock() + + def update_rate(self, amount): + self.lock.acquire() + try : + Measure.update_rate(self,amount) + finally : + self.lock.release() + + Index: BitTorrent/RawServer.py =================================================================== RCS file: /opt/src/cvsroot/bittorrent/BitTorrent/RawServer.py,v retrieving revision 1.1.1.9.2.9 retrieving revision 1.1.1.9.2.11 diff -c -r1.1.1.9.2.9 -r1.1.1.9.2.11 *** BitTorrent/RawServer.py 15 Jun 2004 17:31:32 -0000 1.1.1.9.2.9 --- BitTorrent/RawServer.py 5 Aug 2004 21:45:50 -0000 1.1.1.9.2.11 *************** *** 381,390 **** try : a=s.recv(48) except : ! break if not a : break data+=a ! if len(data)!=48 : s.close() continue s.settimeout(timeout_original) --- 381,390 ---- try : a=s.recv(48) except : ! a=None if not a : break data+=a ! if len(data)<48 : s.close() continue s.settimeout(timeout_original) cvs diff: Diffing osx cvs diff: Diffing osx/BitTorrent.pbproj cvs diff: Diffing osx/Dutch.lproj cvs diff: Diffing osx/Dutch.lproj/DLWindow.nib cvs diff: Diffing osx/Dutch.lproj/MainMenu.nib cvs diff: Diffing osx/Dutch.lproj/Metainfo.nib cvs diff: Diffing osx/Dutch.lproj/Preferences.nib cvs diff: Diffing osx/English.lproj cvs diff: Diffing osx/English.lproj/DLWindow.nib cvs diff: Diffing osx/English.lproj/MainMenu.nib cvs diff: Diffing osx/English.lproj/Metainfo.nib cvs diff: Diffing osx/English.lproj/Preferences.nib cvs diff: Diffing osx/French.lproj cvs diff: Diffing osx/French.lproj/DLWindow.nib cvs diff: Diffing osx/French.lproj/MainMenu.nib cvs diff: Diffing osx/French.lproj/Metainfo.nib