mirror of
https://github.com/OISF/suricata.git
synced 2026-05-28 04:32:12 -04:00
rust: format bittorrent_dht files
Ticket: 3836
This commit is contained in:
parent
f5ac0e201c
commit
e526eb8e2b
2 changed files with 7 additions and 6 deletions
1
.github/workflows/builds.yml
vendored
1
.github/workflows/builds.yml
vendored
|
|
@ -389,6 +389,7 @@ jobs:
|
|||
- run: cargo fmt --check
|
||||
working-directory: rust/derive
|
||||
- run: rustfmt --check rust/src/dns/*.rs rust/src/applayertemplate/*.rs rust/src/asn1/*.rs
|
||||
rust/src/bittorrent_dht/*.rs
|
||||
- name: Check if Cargo.lock.in is up to date
|
||||
run: |
|
||||
cp rust/Cargo.lock rust/Cargo.lock.in
|
||||
|
|
|
|||
|
|
@ -241,17 +241,17 @@ impl FromBencode for BitTorrentDHTResponse {
|
|||
id = value.try_into_bytes().context("id").map(Some)?;
|
||||
}
|
||||
(b"nodes", value) => {
|
||||
let (_, decoded_nodes) =
|
||||
nom8::multi::many0(parse_node).parse(value.try_into_bytes().context("nodes")?)
|
||||
.map_err(|_| Error::malformed_content("nodes.node"))?;
|
||||
let (_, decoded_nodes) = nom8::multi::many0(parse_node)
|
||||
.parse(value.try_into_bytes().context("nodes")?)
|
||||
.map_err(|_| Error::malformed_content("nodes.node"))?;
|
||||
if !decoded_nodes.is_empty() {
|
||||
nodes = Some(decoded_nodes);
|
||||
}
|
||||
}
|
||||
(b"nodes6", value) => {
|
||||
let (_, decoded_nodes) =
|
||||
nom8::multi::many0(parse_node6).parse(value.try_into_bytes().context("nodes6")?)
|
||||
.map_err(|_| Error::malformed_content("nodes6.nodes6"))?;
|
||||
let (_, decoded_nodes) = nom8::multi::many0(parse_node6)
|
||||
.parse(value.try_into_bytes().context("nodes6")?)
|
||||
.map_err(|_| Error::malformed_content("nodes6.nodes6"))?;
|
||||
if !decoded_nodes.is_empty() {
|
||||
nodes6 = Some(decoded_nodes);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue