fix warning and added myactor library

This commit is contained in:
alex 2026-01-15 16:20:25 +08:00
parent d8c908a0b2
commit f9c33b564f
4 changed files with 3 additions and 4 deletions

View File

@ -28,6 +28,7 @@ structopt = "0.3.26"
tokio = { version = "1.38.0", features = ["full"] } tokio = { version = "1.38.0", features = ["full"] }
tokio-util = "0.7.11" tokio-util = "0.7.11"
tracing = "0.1.40" tracing = "0.1.40"
myactor = { git = "https://gitea.s5s8.com/rust/actor-rs.git" }
# rolling-file = { path = "../rolling-file" } # rolling-file = { path = "../rolling-file" }
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]

View File

@ -1,6 +1,5 @@
use punchnet::get_base_dir; use punchnet::get_base_dir;
use punchnet::get_edge; use punchnet::get_edge;
use punchnet::get_my_networks;
use punchnet::mod_hostname; use punchnet::mod_hostname;
use punchnet::restore_dns; use punchnet::restore_dns;
use punchnet::run_sdlan; use punchnet::run_sdlan;
@ -9,11 +8,9 @@ use punchnet::CommandLine;
use punchnet::CommandLineInput; use punchnet::CommandLineInput;
use sdlan_sn_rs::log; use sdlan_sn_rs::log;
use sdlan_sn_rs::utils::gen_uuid_u64;
use tracing::error; use tracing::error;
use std::net::ToSocketAddrs; use std::net::ToSocketAddrs;
use std::time::Duration;
use structopt::StructOpt; use structopt::StructOpt;
#[tokio::main] #[tokio::main]

View File

@ -7,6 +7,7 @@ use tracing::{error};
#[allow(unused)] #[allow(unused)]
pub struct PidRecorder(String); pub struct PidRecorder(String);
#[allow(unused)]
impl PidRecorder { impl PidRecorder {
pub fn new(pidfile: &str) -> Self { pub fn new(pidfile: &str) -> Self {
let pid = std::process::id(); let pid = std::process::id();

View File

@ -78,7 +78,7 @@ impl Socket {
} }
} }
if tos != 0 { if tos != 0 {
if let Err(e) = udp.set_tos(tos) { if let Err(e) = udp.set_tos_v4(tos) {
error!("failed to set tos: {}", e.to_string()); error!("failed to set tos: {}", e.to_string());
} }
} }