Skip to content

Commit

Permalink
handle dns server starting error
Browse files Browse the repository at this point in the history
  • Loading branch information
shiroedev2024 committed Apr 30, 2024
1 parent 631254a commit a042395
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: local local-dev test proto-gen
.PHONY: cli cli-dev test proto-gen

CFG_COMMIT_HASH := $(shell git rev-parse HEAD | cut -c 1-7)
export CFG_COMMIT_HASH := $(CFG_COMMIT_HASH)
Expand Down
8 changes: 5 additions & 3 deletions leaf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use notify::{

#[cfg(all(feature = "inbound-tun", any(target_os = "macos", target_os = "linux", target_os = "windows")))]
use tproxy_config::{TproxyState, TproxyArgs};

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (armv7-unknown-linux-musleabihf)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (aarch64-unknown-linux-musl)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (x86_64-unknown-linux-musl)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (arm-unknown-linux-musleabi)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (i686-unknown-linux-musl)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (x86_64-pc-windows-gnu)

unused import: `TproxyState`

Check warning on line 26 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-apple

unused import: `TproxyState`
use tracing_subscriber::fmt::format;

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (armv7-unknown-linux-musleabihf)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (aarch64-unknown-linux-musl)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (x86_64-unknown-linux-musl)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (arm-unknown-linux-musleabi)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (i686-unknown-linux-musl)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-bin-cross (x86_64-pc-windows-gnu)

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-android

unused import: `tracing_subscriber::fmt::format`

Check warning on line 27 in leaf/src/lib.rs

View workflow job for this annotation

GitHub Actions / build-apple

unused import: `tracing_subscriber::fmt::format`

use app::{
dispatcher::Dispatcher, dns_client::DnsClient, inbound::manager::InboundManager,
Expand Down Expand Up @@ -396,9 +397,10 @@ pub fn start(rt_id: RuntimeId, opts: StartOptions) -> Result<(), Error> {

#[cfg(feature = "dns-server")]
if config.dns.local_dns_server {
if let Ok(r) = app::dns_server::run_dns_server(config.dns.local_dns.to_owned()) {
runners.push(r);
};
runners.push(app::dns_server::run_dns_server(config.dns.local_dns.to_owned()).map_err(|e| Error::Io(io::Error::new(
io::ErrorKind::Other,
format!("failed to start dns server: {}", e)
)))?);
}

let dns_client = Arc::new(RwLock::new(
Expand Down

0 comments on commit a042395

Please sign in to comment.