mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-11 17:42:02 +00:00
Fix #144
This commit is contained in:
parent
c167f45a5e
commit
1e6c6f4f66
2 changed files with 4 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@ tun2proxy.xcframework/
|
|||
.env
|
||||
project.xcworkspace/
|
||||
xcuserdata/
|
||||
.vs/
|
||||
.vscode/
|
||||
.VSCodeCounter/
|
||||
build/
|
||||
|
|
|
@ -68,8 +68,9 @@ fn run_service(_arguments: Vec<std::ffi::OsString>) -> Result<(), crate::BoxErro
|
|||
let default = format!("{:?},trust_dns_proto=warn", args.verbosity);
|
||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or(default)).init();
|
||||
|
||||
let join_handle = tokio::spawn({
|
||||
async move {
|
||||
let rt = tokio::runtime::Builder::new_multi_thread().enable_all().build()?;
|
||||
rt.block_on(async {
|
||||
{
|
||||
unsafe extern "C" fn traffic_cb(status: *const crate::TrafficStatus, _: *mut std::ffi::c_void) {
|
||||
let status = &*status;
|
||||
log::debug!("Traffic: ▲ {} : ▼ {}", status.tx, status.rx);
|
||||
|
@ -80,13 +81,6 @@ fn run_service(_arguments: Vec<std::ffi::OsString>) -> Result<(), crate::BoxErro
|
|||
log::error!("main loop error: {}", err);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let rt = tokio::runtime::Builder::new_multi_thread().enable_all().build()?;
|
||||
rt.block_on(async {
|
||||
if let Err(err) = join_handle.await {
|
||||
log::error!("main_entry error {}", err);
|
||||
}
|
||||
Ok::<(), crate::Error>(())
|
||||
})?;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue