Skip to content

Commit

Permalink
Revert unwanted code added after 0.15.2 tag & Make fixes accordingly (#…
Browse files Browse the repository at this point in the history
…99)

* Revert "Add http event field to store post body (#85)"

This reverts commit fda533e.

* Revert "Update Copyright (#84)"

This reverts commit b7b8c82.

* Fix accordingly after reverting unwanted code added after 0.15.2 tag
  • Loading branch information
sophie-cluml committed Jan 9, 2024
1 parent 2b16047 commit 0588135
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Remove `post_body` field in `Http`

## [0.15.2+tis.0.0.1] - 2024-01-08

### Added
Expand Down Expand Up @@ -224,6 +230,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Move from giganto

[Unreleased]: https://github.com/aicers/giganto-client/compare/0.15.2+tis.0.0.1...tis
[0.15.2+tis.0.0.1]: https://github.com/aicers/giganto-client/compare/0.15.1...0.15.2+tis.0.0.1
[0.15.2]: https://github.com/aicers/giganto-client/compare/0.15.1...0.15.2
[0.15.1]: https://github.com/aicers/giganto-client/compare/0.15.0...0.15.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for data processing and high-speed data transfer.

## License

Copyright 2022-2023 ClumL Inc.
Copyright 2022-2023 ClumL, Inc.

Licensed under [Apache License, Version 2.0][apache-license] (the "License");
you may not use this crate except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions src/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ mod tests {
let nsec = 123;
let ndt = NaiveDateTime::from_timestamp_opt(sec, nsec).unwrap();

let ts = ndt.timestamp_nanos();
let ts = ndt.timestamp_nanos_opt().unwrap();
let ts_fmt = super::convert_time_format(ts);
assert_eq!(ts_fmt, "2.000000123");

let sec = -1;
let nsec = 0;
let ndt = NaiveDateTime::from_timestamp_opt(sec, nsec).unwrap();

let ts = ndt.timestamp_nanos();
let ts = ndt.timestamp_nanos_opt().unwrap();
let ts_fmt = super::convert_time_format(ts);
assert_eq!(ts_fmt, "-1.000000000");
}
Expand Down
8 changes: 1 addition & 7 deletions src/ingest/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,13 @@ pub struct Http {
pub orig_mime_types: Vec<String>,
pub resp_filenames: Vec<String>,
pub resp_mime_types: Vec<String>,
pub post_body: Vec<u8>,
}

impl Display for Http {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
write!(
f,
"{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}",
"{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}",
self.orig_addr,
self.orig_port,
self.resp_addr,
Expand All @@ -272,11 +271,6 @@ impl Display for Http {
vec_to_string_or_default(&self.orig_mime_types),
vec_to_string_or_default(&self.resp_filenames),
vec_to_string_or_default(&self.resp_mime_types),
if self.post_body.is_empty() {
String::from("-")
} else {
std::str::from_utf8(self.post_body.as_slice()).unwrap_or_default().replace('\t', " ")
}
)
}
}
Expand Down
1 change: 0 additions & 1 deletion src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ mod tests {
orig_mime_types: Vec::new(),
resp_filenames: Vec::new(),
resp_mime_types: Vec::new(),
post_body: Vec::new(),
};
let raw_event = bincode::serialize(&http).unwrap();
let source = bincode::serialize(&"hello").unwrap();
Expand Down

0 comments on commit 0588135

Please sign in to comment.