Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
QpxDesign committed Mar 8, 2024
1 parent 87d74c6 commit 8e7e747
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace = { members = [ "tests","tests/obfuscate_access_log_ips"] }
[package]
name = "ngxav"
version = "0.4.9"
version = "0.5.0"
edition = "2021"
license = "MIT"
description = "Search through NGINX logs with advanced filters and support for displaying analytics about your selected log entries"
Expand Down
5 changes: 4 additions & 1 deletion src/utils/read_folder_conserve_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pub fn read_folder_conserve_memory(file_path: String, isUnique: Option<bool>) {
let mut occurrences: HashMap<String, bool> = HashMap::new();
for path in paths {
let p: String = path.unwrap().path().to_str().unwrap().to_string();
if p.contains("error") {
break;
}
if p.contains(".gz") {
let file = File::open(p).expect("Ooops.");
let reader = BufReader::new(GzDecoder::new(file));
Expand All @@ -27,7 +30,7 @@ pub fn read_folder_conserve_memory(file_path: String, isUnique: Option<bool>) {
let ip: String =
line.clone().split(" ").collect::<Vec<&str>>()[0].to_string();

if line.chars().filter(|c| *c == '"').count() > 4
if line.chars().filter(|c| *c == '"').count() > 6
&& line.len() > 20
&& keep_line(&parse_line(&line), true)
{
Expand Down

0 comments on commit 8e7e747

Please sign in to comment.