Skip to content

Commit

Permalink
fix: ASN MMDB fault
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Nov 14, 2023
1 parent 06ae195 commit 10323eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gui/types/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl Sniffer {
let current_capture_id = self.current_capture_id.clone();
let filters = self.filters;
let country_mmdb_reader = self.country_mmdb_reader.clone();
let asn_mmdb_reader = self.country_mmdb_reader.clone();
let asn_mmdb_reader = self.asn_mmdb_reader.clone();
self.status_pair.1.notify_all();
thread::Builder::new()
.name("thread_parse_packets".to_string())
Expand Down
6 changes: 3 additions & 3 deletions src/utils/asn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ pub enum MmdbReader {
Custom(Reader<Vec<u8>>),
}

pub fn mmdb_reader(mmdb_asn_path: &String, default_mmdb: &'static [u8]) -> MmdbReader {
pub fn mmdb_reader(mmdb_path: &String, default_mmdb: &'static [u8]) -> MmdbReader {
let default_reader = maxminddb::Reader::from_source(default_mmdb).unwrap();
if mmdb_asn_path.is_empty() {
if mmdb_path.is_empty() {
MmdbReader::Default(default_reader)
} else {
let custom_reader_result = maxminddb::Reader::open_readfile(mmdb_asn_path);
let custom_reader_result = maxminddb::Reader::open_readfile(mmdb_path);
if let Ok(custom_reader) = custom_reader_result {
return MmdbReader::Custom(custom_reader);
}
Expand Down

0 comments on commit 10323eb

Please sign in to comment.