DHT: better tracking requests/responses

This commit is contained in:
Igor Katson 2023-11-28 10:53:22 +00:00
parent 0478577a72
commit 336bf751e3
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
4 changed files with 182 additions and 97 deletions

View file

@ -1,4 +1,4 @@
use std::{io::BufWriter, net::SocketAddr, path::PathBuf, sync::Arc, time::Duration};
use std::{io::LineWriter, net::SocketAddr, path::PathBuf, sync::Arc, time::Duration};
use anyhow::Context;
use clap::{Parser, ValueEnum};
@ -205,7 +205,7 @@ fn init_logging(opts: &Opts) -> tokio::sync::mpsc::UnboundedSender<String> {
if let Some(log_file) = &opts.log_file {
let log_file = log_file.clone();
let log_file = move || {
BufWriter::new(
LineWriter::new(
std::fs::OpenOptions::new()
.create(true)
.append(true)