@@ -12,9 +12,7 @@ use futures::{future::Either, Future, FutureExt};
12
12
use indicatif:: { MultiProgress , ProgressBar } ;
13
13
use std:: { io:: Write , path:: PathBuf } ;
14
14
15
- use magic_wormhole:: {
16
- dilated_transfer, forwarding, transfer, transit, MailboxConnection , Wormhole ,
17
- } ;
15
+ use magic_wormhole:: { forwarding, transfer, transit, MailboxConnection , Wormhole } ;
18
16
19
17
fn install_ctrlc_handler (
20
18
) -> eyre:: Result < impl Fn ( ) -> futures:: future:: BoxFuture < ' static , ( ) > + Clone > {
@@ -54,14 +52,6 @@ fn install_ctrlc_handler(
54
52
} )
55
53
}
56
54
57
- // send, receive,
58
- #[ derive( Debug , Args ) ]
59
- struct CommonTransferArgs {
60
- /// Enable dilation
61
- #[ clap( long = "with-dilation" , alias = "with-dilation" ) ]
62
- with_dilation : bool ,
63
- }
64
-
65
55
// send, send-many
66
56
#[ derive( Debug , Args ) ]
67
57
struct CommonSenderArgs {
@@ -187,8 +177,6 @@ enum WormholeCommand {
187
177
common_leader : CommonLeaderArgs ,
188
178
#[ clap( flatten) ]
189
179
common_send : CommonSenderArgs ,
190
- #[ clap( flatten) ]
191
- common_transfer : CommonTransferArgs ,
192
180
} ,
193
181
/// Send a file to many recipients. READ HELP PAGE FIRST!
194
182
#[ clap(
@@ -231,8 +219,6 @@ enum WormholeCommand {
231
219
common_follower : CommonFollowerArgs ,
232
220
#[ clap( flatten) ]
233
221
common_receiver : CommonReceiverArgs ,
234
- #[ clap( flatten) ]
235
- common_transfer : CommonTransferArgs ,
236
222
} ,
237
223
/// Forward ports from one machine to another
238
224
#[ clap( subcommand) ]
@@ -305,7 +291,6 @@ async fn main() -> eyre::Result<()> {
305
291
common,
306
292
common_leader : CommonLeaderArgs { code, code_length } ,
307
293
common_send : CommonSenderArgs { file_name, files } ,
308
- common_transfer : CommonTransferArgs { with_dilation : _ } ,
309
294
..
310
295
} => {
311
296
let offer = make_send_offer ( files, file_name) . await ?;
@@ -386,31 +371,17 @@ async fn main() -> eyre::Result<()> {
386
371
common,
387
372
common_follower : CommonFollowerArgs { code } ,
388
373
common_receiver : CommonReceiverArgs { file_path } ,
389
- common_transfer : CommonTransferArgs { with_dilation } ,
390
374
..
391
375
} => {
392
- if with_dilation {
393
- log:: warn!( "The dilation feature is still work in progress. Please remove the `--with-dilation` argument to avoid this." ) ;
394
- }
395
-
396
376
let transit_abilities = parse_transit_args ( & common) ;
397
377
let ( wormhole, _code, relay_hints) = {
398
- let app_config = dilated_transfer:: APP_CONFIG . with_dilation ( with_dilation) ;
399
- let app_config = if with_dilation {
400
- app_config. app_version ( dilated_transfer:: AppVersion :: new ( Some (
401
- dilated_transfer:: FileTransferV2Mode :: Receive ,
402
- ) ) )
403
- } else {
404
- app_config
405
- } ;
406
-
407
378
let connect_fut = Box :: pin ( parse_and_connect (
408
379
& mut term,
409
380
common,
410
381
code,
411
382
None ,
412
383
false ,
413
- app_config ,
384
+ transfer :: APP_CONFIG ,
414
385
None ,
415
386
clipboard. as_mut ( ) ,
416
387
) ) ;
@@ -420,21 +391,15 @@ async fn main() -> eyre::Result<()> {
420
391
}
421
392
} ;
422
393
423
- if with_dilation && peer_allows_dilation ( wormhole. peer_version ( ) ) {
424
- log:: debug!( "dilate wormhole" ) ;
425
- let mut dilated_wormhole = wormhole. dilate ( ) ?; // need to pass transit relay URL
426
- dilated_wormhole. run ( ) . await ;
427
- } else {
428
- Box :: pin ( receive (
429
- wormhole,
430
- relay_hints,
431
- & file_path,
432
- noconfirm,
433
- transit_abilities,
434
- ctrl_c,
435
- ) )
436
- . await ?;
437
- }
394
+ Box :: pin ( receive (
395
+ wormhole,
396
+ relay_hints,
397
+ & file_path,
398
+ noconfirm,
399
+ transit_abilities,
400
+ ctrl_c,
401
+ ) )
402
+ . await ?;
438
403
} ,
439
404
WormholeCommand :: Forward ( ForwardCommand :: Serve {
440
405
targets,
@@ -587,11 +552,6 @@ async fn main() -> eyre::Result<()> {
587
552
Ok ( ( ) )
588
553
}
589
554
590
- fn peer_allows_dilation ( _version : & serde_json:: Value ) -> bool {
591
- // TODO needs to be implemented
592
- true
593
- }
594
-
595
555
fn parse_transit_args ( args : & CommonArgs ) -> transit:: Abilities {
596
556
match ( args. force_direct , args. force_relay ) {
597
557
( false , false ) => transit:: Abilities :: ALL_ABILITIES ,
@@ -905,6 +865,7 @@ async fn send_many(
905
865
MailboxConnection :: connect ( transfer:: APP_CONFIG , code. clone ( ) , false ) . await ?,
906
866
)
907
867
. await ?;
868
+
908
869
send_in_background (
909
870
relay_hints. clone ( ) ,
910
871
make_send_offer ( files. clone ( ) , file_name. clone ( ) ) . await ?,
0 commit comments