diff options
-rw-r--r-- | client-native-rift/src/main.rs | 13 | ||||
-rw-r--r-- | readme.md | 9 |
2 files changed, 21 insertions, 1 deletions
diff --git a/client-native-rift/src/main.rs b/client-native-rift/src/main.rs index b9e38c0..0484d40 100644 --- a/client-native-rift/src/main.rs +++ b/client-native-rift/src/main.rs @@ -18,6 +18,7 @@ use log::{debug, error, info, warn}; use std::{ os::unix::prelude::MetadataExt, pin::Pin, + process::exit, sync::{ atomic::{AtomicUsize, Ordering}, Arc, @@ -55,6 +56,9 @@ pub struct Args { secret: String, #[clap(subcommand)] action: Action, + /// end after completion of the first transfer + #[clap(short, long)] + one_file: bool, } async fn run() { @@ -155,6 +159,7 @@ impl EventHandler for Handler { Arc::new(RwLock::new(None)); { let writer = writer.clone(); + let s = s.clone(); dc.on_open(box move || { let s = s.clone(); let writer = writer.clone(); @@ -167,11 +172,16 @@ impl EventHandler for Handler { } { let writer = writer.clone(); + let args = s.args.clone(); dc.on_close(box move || { let writer = writer.clone(); + let args = args.clone(); Box::pin(async move { info!("channel closed"); *writer.write().await = None; + if args.one_file { + exit(0); + } }) }) .await; @@ -334,6 +344,9 @@ impl LocalResource for FileSender { }) .await; } + + channel.set_buffered_amount_low_threshold(1 << 20).await; + channel .on_error(box move |err| Box::pin(async move { error!("channel error: {err}") })) .await; @@ -83,12 +83,19 @@ system works as follows: | `SPC C-c` | End all tracks | | `C-v`\* | Paste image in chat (does not require chat to be shown) | +## Debugging + +- If a connection cant be established, look at it with `webrtc_debug` enabled. +- In case downloading files doesn't work, check if the service worker was + installed correctly by visiting `/swtest` +- If it still doesn't work, file a bug report. + ## Parameters Some configuration parameters can be added like query params but **after** the section. (e.g `/room#mymeeting?username=alice`) The page will not automatically reload if the section changes. Booleans can be either `1`, `true`, `yes` or -their opposites. I convenience function for changing params is also exported: +their opposites. A convenience function for changing params is also exported: `window.change_pref(key, value)` | Option name | Type | Default | Description | |