From 27da35cc4d928b3819717b4b88a4a425e7219567 Mon Sep 17 00:00:00 2001 From: inpos Date: Fri, 11 Mar 2016 21:42:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B5=20=D0=B7=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D1=80=D0=B6=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon.xml | 2 +- lib/pyrrent2http/__init__.py | 1 - lib/pyrrent2http/engine.py | 11 ++++++----- lib/pyrrent2http/pyrrent2http.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addon.xml b/addon.xml index 543cf22..907a37f 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/lib/pyrrent2http/__init__.py b/lib/pyrrent2http/__init__.py index cff4053..6b7891d 100644 --- a/lib/pyrrent2http/__init__.py +++ b/lib/pyrrent2http/__init__.py @@ -40,5 +40,4 @@ PeerInfo = namedtuple('PeerInfo', "ip, flags, source, up_speed, down_speed, tota "country, client") from engine import Engine -from platform import Platform from error import Error diff --git a/lib/pyrrent2http/engine.py b/lib/pyrrent2http/engine.py index 0033083..1eff75c 100644 --- a/lib/pyrrent2http/engine.py +++ b/lib/pyrrent2http/engine.py @@ -235,7 +235,7 @@ class Engine: self.pyrrent2http_loop.start() - start = time.time() + '''start = time.time() self.started = True initialized = False while (time.time() - start) < self.startup_timeout: @@ -251,7 +251,7 @@ class Engine: if not initialized: self.started = False - raise Error("Can't start pyrrent2http, time is out", Error.TIMEOUT) + raise Error("Can't start pyrrent2http, time is out", Error.TIMEOUT)''' self._log("pyrrent2http successfully started.") def check_torrent_error(self, status=None): @@ -354,7 +354,7 @@ class Engine: :param wait_timeout: Time in seconds to wait until pyrrent2http client shut down """ - self.wait_on_close_timeout = wait_timeout + #self.wait_on_close_timeout = wait_timeout def close(self): """ @@ -364,7 +364,7 @@ class Engine: if self.is_alive(): self._log("Shutting down pyrrent2http...") self.pyrrent2http.shutdown() - finished = False + '''finished = False if self.wait_on_close_timeout is not None: start = time.time() while (time.time() - start) < self.wait_on_close_timeout: @@ -376,7 +376,8 @@ class Engine: self._log("PANIC: Timeout occurred while shutting down pyrrent2http thread") else: self._log("pyrrent2http successfully shut down.") - self.wait_on_close_timeout = None + self.wait_on_close_timeout = None''' + self._log("pyrrent2http successfully shut down.") self.started = False self.logpipe = None self.process = None diff --git a/lib/pyrrent2http/pyrrent2http.py b/lib/pyrrent2http/pyrrent2http.py index 4f10926..eb49049 100644 --- a/lib/pyrrent2http/pyrrent2http.py +++ b/lib/pyrrent2http/pyrrent2http.py @@ -441,7 +441,7 @@ def HttpHandlerFactory(): chunk = end_range - start_range buf = bytearray(chunk) try: - f.Read(buf) + count = f.Read(buf) self.wfile.write(buf) except: break