From 106991fe0d521873a92ac8c0e3cb7623928aa3b1 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 25 Mar 2015 13:07:17 -0700 Subject: [PATCH] require caller to provide transit relay too --- src/wormhole/blocking/transit.py | 5 ++--- src/wormhole/scripts/cmd_receive_file.py | 2 +- src/wormhole/scripts/cmd_send_file.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wormhole/blocking/transit.py b/src/wormhole/blocking/transit.py index fad7122..b7f7e78 100644 --- a/src/wormhole/blocking/transit.py +++ b/src/wormhole/blocking/transit.py @@ -2,7 +2,6 @@ from __future__ import print_function import re, time, threading, socket, SocketServer from binascii import hexlify, unhexlify from nacl.secret import SecretBox -from .. import const from ..util import ipaddrs from ..util.hkdf import HKDF @@ -270,8 +269,8 @@ class RecordPipe: self.skt.close() class Common: - def __init__(self, transit_relay=None): - self._transit_relay = transit_relay or const.TRANSIT_RELAY + def __init__(self, transit_relay): + self._transit_relay = transit_relay self.winning = threading.Event() self._negotiation_check_lock = threading.Lock() self._have_transit_key = threading.Condition() diff --git a/src/wormhole/scripts/cmd_receive_file.py b/src/wormhole/scripts/cmd_receive_file.py index d7ae9ef..cacc5df 100644 --- a/src/wormhole/scripts/cmd_receive_file.py +++ b/src/wormhole/scripts/cmd_receive_file.py @@ -8,7 +8,7 @@ APPID = "lothar.com/wormhole/file-xfer" def receive_file(args): # we're receiving - transit_receiver = TransitReceiver(transit_relay=args.transit_helper) + transit_receiver = TransitReceiver(args.transit_helper) r = Receiver(APPID, args.relay_url) code = args.code diff --git a/src/wormhole/scripts/cmd_send_file.py b/src/wormhole/scripts/cmd_send_file.py index 8384295..23fe34d 100644 --- a/src/wormhole/scripts/cmd_send_file.py +++ b/src/wormhole/scripts/cmd_send_file.py @@ -10,7 +10,7 @@ def send_file(args): # we're sending filename = args.filename assert os.path.isfile(filename) - transit_sender = TransitSender(transit_relay=args.transit_helper) + transit_sender = TransitSender(args.transit_helper) i = Initiator(APPID, args.relay_url) code = i.get_code(args.code_length)