From 670a4bd19293ed2e6ab6d09d978b4b9975123b0b Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 21 Aug 2024 12:16:35 +0200 Subject: [PATCH] fix it again because of tokio updates --- Cargo.toml | 4 ++-- src/client/mod.rs | 8 ++------ src/common/args.rs | 11 +++++++++-- src/server/mod.rs | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 469d86a..fa8dc85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,12 +17,12 @@ anyhow = "1.0.79" clap = "4.4.18" clap-num = "1.0.2" clap-verbosity-flag = "2.1.2" -libpt = { version = "0.3.11", features = ["net"] } thiserror = "1.0.56" -tokio = { version = "1.35.1", features = ["net", "rt", "macros"] } +tokio = { version = "1.35.1", features = ["net", "rt-multi-thread", "macros", "time", "io-util"] } rustls-pemfile = "2.0.0" tokio-rustls = "0.25.0" webpki-roots = "0.26.0" +libpt = { version = "0.6.0", features = ["log"] } [features] default = ["server"] diff --git a/src/client/mod.rs b/src/client/mod.rs index cb8c325..55dad0a 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -3,18 +3,14 @@ use std::{fs::File, io::BufReader, sync::Arc}; use crate::{common::decode, Config}; -use anyhow; use libpt::log::{error, info, trace}; use rustls_pemfile::certs; -use tokio::{ - io::{AsyncReadExt, AsyncWriteExt}, - net::TcpStream, -}; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::net::TcpStream; use tokio_rustls::{ rustls::{self, pki_types}, TlsConnector, TlsStream, }; -use webpki_roots; const BUF_SIZE: usize = 512; diff --git a/src/common/args.rs b/src/common/args.rs index 64c8d2b..220c5f3 100644 --- a/src/common/args.rs +++ b/src/common/args.rs @@ -74,10 +74,17 @@ impl Cli { } }; if cli.meta { - Logger::init(None, Some(ll), true).expect("could not initialize Logger"); + let _ = Logger::builder() + .set_level(ll) + .display_filename(true) + .build() + .expect("could not initialize Logger"); } else { // less verbose version - Logger::init_mini(Some(ll)).expect("could not initialize Logger"); + let _ = Logger::builder() + .set_level(ll) + .build() + .expect("could not initialize Logger"); } return cli; } diff --git a/src/server/mod.rs b/src/server/mod.rs index 007a95a..899f2c9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -13,7 +13,7 @@ use rustls_pemfile::{certs, private_key}; use tokio::{ io::{AsyncReadExt, AsyncWriteExt}, net::{TcpListener, TcpStream}, - time::{self}, + time, }; use tokio_rustls::{rustls, TlsAcceptor};