|
@@ -24,6 +24,15 @@ class WOMode(Enum):
|
|
TELESCOPING = 1 # Telescoping Walking Onions
|
|
TELESCOPING = 1 # Telescoping Walking Onions
|
|
SINGLEPASS = 2 # Single-Pass Walking Onions
|
|
SINGLEPASS = 2 # Single-Pass Walking Onions
|
|
|
|
|
|
|
|
+ def string_to_type(type_input):
|
|
|
|
+ reprs = {'vanilla': WOMode.VANILLA, 'telescoping': WOMode.TELESCOPING,
|
|
|
|
+ 'single-pass': WOMode.SINGLEPASS }
|
|
|
|
+
|
|
|
|
+ if type_input in reprs.keys():
|
|
|
|
+ return reprs[type_input]
|
|
|
|
+
|
|
|
|
+ return -1
|
|
|
|
+
|
|
|
|
|
|
class SNIPAuthMode(Enum):
|
|
class SNIPAuthMode(Enum):
|
|
"""The different styles of SNIP authentication"""
|
|
"""The different styles of SNIP authentication"""
|
|
@@ -264,7 +273,7 @@ class ClientConnection(Connection):
|
|
NetMsgs, which then get ignored. Use subclasses of this class when
|
|
NetMsgs, which then get ignored. Use subclasses of this class when
|
|
the server required no per-connection state, such as just fetching
|
|
the server required no per-connection state, such as just fetching
|
|
consensus documents."""
|
|
consensus documents."""
|
|
-
|
|
|
|
|
|
+
|
|
def __init__(self, peer):
|
|
def __init__(self, peer):
|
|
"""Create a ClientConnection object with the given peer. The
|
|
"""Create a ClientConnection object with the given peer. The
|
|
peer must have a received(client, msg) method."""
|
|
peer must have a received(client, msg) method."""
|