|
@@ -291,12 +291,19 @@ class ClientChannelManager(relay.ChannelManager):
|
|
|
|
|
|
def new_circuit(self):
|
|
|
"""Create a new circuit from this client."""
|
|
|
- if network.thenetwork.womode == network.WOMode.VANILLA:
|
|
|
- return self.new_circuit_vanilla()
|
|
|
- elif network.thenetwork.womode == network.WOMode.TELESCOPING:
|
|
|
- return self.new_circuit_telescoping()
|
|
|
- elif network.thenetwork.womode == network.WOMode.SINGLEPASS:
|
|
|
- sys.exit("NOT YET IMPLEMENTED")
|
|
|
+ circhandler = None
|
|
|
+
|
|
|
+ # If an error occured, circhandler will still be None, so we should
|
|
|
+ # try again.
|
|
|
+ while circhandler is None:
|
|
|
+ if network.thenetwork.womode == network.WOMode.VANILLA:
|
|
|
+ circhandler = self.new_circuit_vanilla()
|
|
|
+ elif network.thenetwork.womode == network.WOMode.TELESCOPING:
|
|
|
+ circhandler = self.new_circuit_telescoping()
|
|
|
+ elif network.thenetwork.womode == network.WOMode.SINGLEPASS:
|
|
|
+ sys.exit("NOT YET IMPLEMENTED")
|
|
|
+
|
|
|
+ return circhandler
|
|
|
|
|
|
def received_msg(self, msg, peeraddr, channel):
|
|
|
"""Callback when a NetMsg not specific to a circuit is
|