mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-10 00:27:46 +00:00
Introduce cancellation token and reduce amount of code (#88)
Test passed on Android. Thanks a lot.
This commit is contained in:
parent
2434c62524
commit
2a9775ce2e
8 changed files with 59 additions and 126 deletions
|
@ -4,7 +4,7 @@ use crate::{
|
|||
args::{ArgDns, ArgProxy},
|
||||
ArgVerbosity, Args,
|
||||
};
|
||||
use std::os::raw::{c_char, c_int, c_uint};
|
||||
use std::os::raw::{c_char, c_int, c_ushort};
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
|
@ -13,7 +13,7 @@ use std::os::raw::{c_char, c_int, c_uint};
|
|||
pub unsafe extern "C" fn tun2proxy_run(
|
||||
proxy_url: *const c_char,
|
||||
tun_fd: c_int,
|
||||
tun_mtu: c_uint,
|
||||
tun_mtu: c_ushort,
|
||||
dns_strategy: ArgDns,
|
||||
verbosity: ArgVerbosity,
|
||||
) -> c_int {
|
||||
|
@ -25,7 +25,7 @@ pub unsafe extern "C" fn tun2proxy_run(
|
|||
|
||||
let args = Args::new(Some(tun_fd), proxy, dns_strategy, verbosity);
|
||||
|
||||
crate::api::tun2proxy_internal_run(args, tun_mtu as _)
|
||||
crate::api::tun2proxy_internal_run(args, tun_mtu)
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue