[Pkg-privacy-commits] [obfsproxy] 84/353: Trivial code improvements.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit 0f5fd622f0736ac0235a955358b413af2590f70e
Author: George Kadianakis <desnacked at riseup.net>
Date:   Fri Nov 2 05:23:20 2012 +0200

    Trivial code improvements.
    
    * Don't call the first heartbeat.
    * s/Daemon/Transport
---
 obfsproxy.py                  |  2 +-
 obfsproxy/transports/b64.py   |  8 ++++----
 obfsproxy/transports/base.py  |  6 +++---
 obfsproxy/transports/dummy.py | 12 ++++++------
 obfsproxy/transports/obfs2.py | 12 ++++++------
 5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/obfsproxy.py b/obfsproxy.py
index f3af07f..3115662 100755
--- a/obfsproxy.py
+++ b/obfsproxy.py
@@ -111,7 +111,7 @@ def main(argv):
 
     # Fire up our heartbeat.
     l = task.LoopingCall(heartbeat.heartbeat.talk)
-    l.start(3600.0) # do heartbeat every hour
+    l.start(3600.0, now=False) # do heartbeat every hour
 
     # Initiate obfsproxy.
     if (args.name == 'managed'):
diff --git a/obfsproxy/transports/b64.py b/obfsproxy/transports/b64.py
index 9a83b73..8e52324 100644
--- a/obfsproxy/transports/b64.py
+++ b/obfsproxy/transports/b64.py
@@ -3,7 +3,7 @@
 
 """ This module contains an implementation of the 'b64' transport. """
 
-from obfsproxy.transports.base import BaseDaemon
+from obfsproxy.transports.base import BaseTransport
 
 import base64
 
@@ -37,7 +37,7 @@ def _get_b64_chunks_from_str(string):
 
     return chunks
 
-class B64Daemon(BaseDaemon):
+class B64Transport(BaseTransport):
     """
     Implements the b64 protocol. A protocol that encodes data with
     base64 before pushing them to the network.
@@ -76,11 +76,11 @@ class B64Daemon(BaseDaemon):
         return
 
 
-class B64Client(B64Daemon):
+class B64Client(B64Transport):
     pass
 
 
-class B64Server(B64Daemon):
+class B64Server(B64Transport):
     pass
 
 
diff --git a/obfsproxy/transports/base.py b/obfsproxy/transports/base.py
index bea8a5e..131c91a 100644
--- a/obfsproxy/transports/base.py
+++ b/obfsproxy/transports/base.py
@@ -4,7 +4,7 @@
 import obfsproxy.common.log as log
 
 """
-This module contains BaseDaemon, a pluggable transport skeleton class.
+This module contains BaseTransport, a pluggable transport skeleton class.
 """
 
 def addrport(string):
@@ -21,9 +21,9 @@ def addrport(string):
 
     return addrport
 
-class BaseDaemon:
+class BaseTransport:
     """
-    The BaseDaemon class is a skeleton class for pluggable transports.
+    The BaseTransport class is a skeleton class for pluggable transports.
     It contains callbacks that your pluggable transports should
     override and customize.
     """
diff --git a/obfsproxy/transports/dummy.py b/obfsproxy/transports/dummy.py
index 02e321e..ad8d56c 100644
--- a/obfsproxy/transports/dummy.py
+++ b/obfsproxy/transports/dummy.py
@@ -3,10 +3,10 @@
 
 """ This module contains an implementation of the 'dummy' transport. """
 
-from obfsproxy.transports.base import BaseDaemon
+from obfsproxy.transports.base import BaseTransport
 
 
-class DummyDaemon(BaseDaemon):
+class DummyTransport(BaseTransport):
     """
     Implements the dummy protocol. A protocol that simply proxies data
     without obfuscating them.
@@ -26,21 +26,21 @@ class DummyDaemon(BaseDaemon):
 
         circuit.downstream.write(data.read())
 
-class DummyClient(DummyDaemon):
+class DummyClient(DummyTransport):
 
     """
     DummyClient is a client for the 'dummy' protocol.
-    Since this protocol is so simple, the client and the server are identical and both just trivially subclass DummyDaemon.
+    Since this protocol is so simple, the client and the server are identical and both just trivially subclass DummyTransport.
     """
 
     pass
 
 
-class DummyServer(DummyDaemon):
+class DummyServer(DummyTransport):
 
     """
     DummyServer is a server for the 'dummy' protocol.
-    Since this protocol is so simple, the client and the server are identical and both just trivially subclass DummyDaemon.
+    Since this protocol is so simple, the client and the server are identical and both just trivially subclass DummyTransport.
     """
 
     pass
diff --git a/obfsproxy/transports/obfs2.py b/obfsproxy/transports/obfs2.py
index 0ee2c10..f2838fb 100644
--- a/obfsproxy/transports/obfs2.py
+++ b/obfsproxy/transports/obfs2.py
@@ -61,9 +61,9 @@ def mac(s, x):
 
     return h(s + x + s)
 
-class Obfs2Daemon(base.BaseDaemon):
+class Obfs2Transport(base.BaseTransport):
     """
-    Obfs2Daemon implements the obfs2 protocol.
+    Obfs2Transport implements the obfs2 protocol.
     """
 
     def __init__(self):
@@ -209,7 +209,7 @@ class Obfs2Daemon(base.BaseDaemon):
         secret = mac(pad_string, seed)
         return aes.AES_CTR_128(secret[:KEYLEN], secret[KEYLEN:])
 
-class Obfs2Client(Obfs2Daemon):
+class Obfs2Client(Obfs2Transport):
 
     """
     Obfs2Client is a client for the obfs2 protocol.
@@ -223,10 +223,10 @@ class Obfs2Client(Obfs2Daemon):
         self.recv_keytype = "Responder obfuscated data"
         self.we_are_initiator = True
 
-        Obfs2Daemon.__init__(self)
+        Obfs2Transport.__init__(self)
 
 
-class Obfs2Server(Obfs2Daemon):
+class Obfs2Server(Obfs2Transport):
 
     """
     Obfs2Server is a server for the obfs2 protocol.
@@ -240,6 +240,6 @@ class Obfs2Server(Obfs2Daemon):
         self.recv_keytype = "Initiator obfuscated data"
         self.we_are_initiator = False
 
-        Obfs2Daemon.__init__(self)
+        Obfs2Transport.__init__(self)
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list