updates on init functions

This commit is contained in:
Paul 2022-09-17 21:49:03 +02:00
parent 48df5def78
commit b66c2ee677
2 changed files with 3 additions and 6 deletions

View File

@ -57,10 +57,7 @@ impl Context {
// Build context
let mut ctx = Context {
cfg: Config::new(),
flags: Flags {
debug: debug,
server: server,
},
flags: Flags { debug, server },
hostname: gethostname(true),
discovery: Discovery {
version: "1.0".to_string(),
@ -181,7 +178,7 @@ impl Context {
tryfail = 100;
}
let starttime: DateTime<FixedOffset> =
DateTime::parse_from_rfc2822(ipdata.date.as_str()).unwrap();
DateTime::parse_from_rfc3339(ipdata.date.as_str()).unwrap();
match self.cfg.sets.get(&ipdata.src) {
Some(set) => {
self.blocklist.insert(

View File

@ -20,7 +20,7 @@ pub async fn process(ctx: &Arc<Mutex<Context>>) {
let (ipdatatx, mut ipdatarx): (Sender<IpData>, Receiver<IpData>) = channel(ZMQ_CHAN_SIZE);
// initialize the firewall table
firewall::init(&env!("CARGO_PKG_NAME").to_string());
//firewall::init(&env!("CARGO_PKG_NAME").to_string());
// initialize zeromq sockets
let reqsocket;