Commit ce6fbac0 authored by Ian Jackson's avatar Ian Jackson 💬
Browse files

Merge branch 'bootstrap_second' into 'main'

arti: create TorClient first, then bootstrap.

Closes #336

See merge request tpo/core/arti!320
parents 516a2a3d c6c45316
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -110,16 +110,15 @@ async fn run<R: Runtime>(
    client_config: TorClientConfig,
) -> Result<()> {
    use futures::FutureExt;
    let client = TorClient::create_unbootstrapped(runtime.clone(), client_config)?;
    futures::select!(
        r = exit::wait_for_ctrl_c().fuse() => r,
        r = async {
            let client = TorClient::create_bootstrapped(
                    runtime.clone(),
                    client_config,
                ).await?;
            if arti_config.application().watch_configuration() {
                watch_cfg::watch_for_config_changes(config_sources, arti_config, client.clone())?;
            }
            client.bootstrap().await?;
            info!("Sufficiently bootstrapped; opening SOCKS proxy listeners.");
            proxy::run_socks_proxy(runtime, client, socks_port).await
        }.fuse() => r,
    )