Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cn-kali-team committed Jul 20, 2024
1 parent a75d9c2 commit 3309fde
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Change Log

<!-- next-header -->
## [2024.7.20] - 2024.7.20

### Fixes

- 修复部分没有端口的探针
- tcp添加超时计时器
- 更新依赖
- 替换输出换行符

## [Unreleased] - ReleaseDate

Expand Down
8 changes: 4 additions & 4 deletions 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 engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fancy-regex = { version = "0.13.0", default-features = false, features = [
jsonpath-rust = "0.6.1"
serde_json = "1"
#git = "https://github.com/emo-crab/slinger",
slinger = { version = "0.1.3", features = [
slinger = { version = "0.1.4", features = [
"serde",
"cookie",
"tls",
Expand Down
2 changes: 1 addition & 1 deletion observer_ward/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl ObserverWardConfig {
pub fn http_client_builder(&self) -> ClientBuilder {
let mut client_builder = ClientBuilder::new();
client_builder = client_builder.redirect(Policy::Custom(only_same_host));
client_builder = client_builder.timeout(Duration::from_secs(self.timeout));
client_builder = client_builder.timeout(Some(Duration::from_secs(self.timeout)));
if let Ok(ua) = HeaderValue::from_str(&self.ua) {
client_builder = client_builder.user_agent(ua);
}
Expand Down
4 changes: 3 additions & 1 deletion observer_ward/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ impl ClusterExecuteRunner {
}
}
}

// 处理http的探针
impl ClusterExecuteRunner {
fn http(
Expand All @@ -215,7 +216,6 @@ impl ClusterExecuteRunner {
// 可能会有多个http,一般只有一个,多个会有flow控制
for http in cluster.requests.http.iter() {
let mut client_builder = http.http_option.builder_client();
client_builder = client_builder.timeout(Duration::from_secs(config.timeout));
client_builder = client_builder.redirect(Policy::Custom(only_same_host));
if let Ok(ua) = HeaderValue::from_str(&config.ua) {
client_builder = client_builder.user_agent(ua);
Expand Down Expand Up @@ -250,6 +250,7 @@ impl ClusterExecuteRunner {
Ok(())
}
}

// 处理tcp的探针
impl ClusterExecuteRunner {
// 单个tcp
Expand Down Expand Up @@ -320,6 +321,7 @@ impl ClusterExecuteRunner {
Ok(flag)
}
}

// yaml字符串转字节
fn input_to_byte(payload: &str) -> Vec<u8> {
let mut buf = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion observer_ward/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct Output {
fn set_to_string(set: &HashSet<String>) -> String {
set
.iter()
.map(|x| x.trim().to_string())
.map(|x| x.trim().to_string().replace("\r\n", " ").replace('\t', ""))
.collect::<HashSet<_>>()
.iter()
.cloned()
Expand Down

0 comments on commit 3309fde

Please sign in to comment.