From 142f3fc154c74d0ec4e278e96d6a1a664c1664b5 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 17 Feb 2016 18:56:58 -0800 Subject: [PATCH] send-blocking: don't create Transit unless we need it --- src/wormhole/scripts/cmd_send_blocking.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/wormhole/scripts/cmd_send_blocking.py b/src/wormhole/scripts/cmd_send_blocking.py index 29349e5..92ce51c 100644 --- a/src/wormhole/scripts/cmd_send_blocking.py +++ b/src/wormhole/scripts/cmd_send_blocking.py @@ -17,12 +17,13 @@ def send_blocking(args): print(u"On the other computer, please run: %s" % other_cmd, file=args.stdout) - transit_sender = TransitSender(args.transit_helper) - transit_data = { - "direct_connection_hints": transit_sender.get_direct_hints(), - "relay_connection_hints": transit_sender.get_relay_hints(), - } - phase1["transit"] = transit_data + if fd_to_send is not None: + transit_sender = TransitSender(args.transit_helper) + transit_data = { + "direct_connection_hints": transit_sender.get_direct_hints(), + "relay_connection_hints": transit_sender.get_relay_hints(), + } + phase1["transit"] = transit_data with Wormhole(APPID, args.relay_url) as w: if args.code: