Disable upload: do not expose in default builds, move under a feature flag.

This commit is contained in:
Igor Katson 2024-10-03 09:01:38 +01:00
parent b99a1e2b73
commit 990c5f866b
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
11 changed files with 45 additions and 16 deletions

View file

@ -21,6 +21,7 @@ default-tls = ["librqbit/default-tls"]
rust-tls = ["librqbit/rust-tls"]
debug_slow_disk = ["librqbit/storage_middleware"]
postgres = ["librqbit/postgres"]
disable-upload = ["librqbit/disable-upload"]
[dependencies]
librqbit = { version = "7.1.0-beta.0", path = "../librqbit", default-features = false, features = [

View file

@ -215,6 +215,7 @@ struct Opts {
///
/// Might be useful e.g. if rqbit upload consumes all your upload bandwidth and interferes
/// with your other Internet usage.
#[cfg(feature = "disable-upload")]
#[arg(long, env = "RQBIT_DISABLE_UPLOAD")]
disable_upload: bool,
}
@ -474,6 +475,7 @@ async fn async_main(opts: Opts, cancel: CancellationToken) -> anyhow::Result<()>
root_span: None,
fastresume: false,
cancellation_token: Some(cancel.clone()),
#[cfg(feature = "disable-upload")]
disable_upload: opts.disable_upload,
};