Skip to content

Commit ec81cb1

Browse files
yuanchaoakylewanginchina
authored andcommitted
fix: Do not parse Dubbo heartbeat messages
1 parent 6151641 commit ec81cb1

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • agent/src/flow_generator/protocol_logs/rpc

agent/src/flow_generator/protocol_logs/rpc/dubbo.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,12 +1181,20 @@ impl DubboHeader {
11811181
self.status_code = payload[3];
11821182
self.request_id = read_u64_be(&payload[4..]) as i64;
11831183
self.data_length = read_u32_be(&payload[12..]) as i32;
1184+
if self.is_event() {
1185+
return Err(Error::DubboHeaderParseFailed);
1186+
}
1187+
11841188
Ok(())
11851189
}
11861190

1191+
pub fn is_event(&self) -> bool {
1192+
self.event == 1
1193+
}
1194+
11871195
pub fn check(&self) -> bool {
1188-
// 不通过响应识别Dubbo
1189-
if self.data_type == 0 {
1196+
// 不通过响应和事件识别Dubbo
1197+
if self.data_type == 0 || self.is_event() {
11901198
return false;
11911199
}
11921200
// 请求时状态码一定是0

0 commit comments

Comments
 (0)