Added new option -l to write log messages to file. Changed old -l flag to -b.

This commit is contained in:
Revertron
2021-04-17 16:45:49 +02:00
parent 64b353f069
commit f16a95f51e
6 changed files with 107 additions and 54 deletions
+6 -1
View File
@@ -31,4 +31,9 @@ pub const ZONE_MAX_LENGTH: usize = 10;
pub const MAX_RECONNECTS: u32 = 5;
pub const CLASS_ZONE: &str = "zone";
pub const CLASS_DOMAIN: &str = "domain";
pub const CLASS_DOMAIN: &str = "domain";
/// Public nodes listen port
pub const LISTEN_PORT: u16 = 4244;
pub const UI_REFRESH_DELAY_MS: u128 = 250;
pub const LOG_REFRESH_DELAY_SEC: u64 = 60;
+16 -6
View File
@@ -1,14 +1,17 @@
use std::num;
use rand::Rng;
pub mod constants;
pub use constants::*;
use std::net::IpAddr;
use std::num;
use mio::Token;
use rand::Rng;
#[cfg(not(target_os = "macos"))]
use thread_priority::*;
pub use constants::*;
use crate::dns::protocol::DnsRecord;
pub mod constants;
/// Convert bytes array to HEX format
pub fn to_hex(buf: &[u8]) -> String {
let mut result = String::new();
@@ -95,6 +98,13 @@ pub fn is_yggdrasil(addr: &IpAddr) -> bool {
false
}
/// Gets new token from old token, mutating the last
pub fn next(current: &mut Token) -> Token {
let next = current.0;
current.0 += 1;
Token(next)
}
/// Checks if this record has IP from Yggdrasil network
/// https://yggdrasil-network.github.io
pub fn is_yggdrasil_record(record: &DnsRecord) -> bool {
@@ -134,8 +144,8 @@ pub fn setup_miner_thread(cpu: u32) {
#[cfg(test)]
mod test {
use crate::{check_domain, is_yggdrasil};
use std::net::IpAddr;
use crate::{check_domain, is_yggdrasil};
#[test]
fn test_check_domain() {