Skip to content

Commit b4290f5

Browse files
committed
htp: convert to nom 8
Minimal commit, with usage of deprecated APIs.
1 parent 6a03974 commit b4290f5

9 files changed

Lines changed: 177 additions & 133 deletions

File tree

rust/Cargo.lock.in

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/htp/Cargo.toml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ crate-type = ["staticlib", "rlib", "cdylib"]
2424
base64 = "0.22.1"
2525
bstr = "1.12.0"
2626
libc = "0.2"
27-
nom = "7.1.3"
27+
nom = "8.0.0"
2828
lzma-rs = { version = "0.2.0", features = ["stream"] }
2929
flate2 = { version = "~1.0.35", features = ["zlib-default"], default-features = false }
3030
brotli = "~8.0.1"

rust/htp/src/decompressors.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,10 @@ impl GzipBufWriter {
456456
use nom::bytes::streaming::tag;
457457
use nom::number::streaming::{le_i32, le_u8};
458458
use nom::sequence::tuple;
459+
use nom::Parser as _;
459460

460461
let (rest, (_, flags, _mtime, _xfl, _operating_system)) =
461-
tuple((tag(b"\x1f\x8b\x08"), le_u8, le_i32, le_u8, le_u8))(data)?;
462+
tuple((tag(&b"\x1f\x8b\x08"[..]), le_u8, le_i32, le_u8, le_u8)).parse(data)?;
462463
Ok((rest, flags))
463464
}
464465
}
@@ -536,7 +537,7 @@ impl Write for GzipBufWriter {
536537
if self.flags & FNAME != 0 {
537538
match tuple((
538539
take_until::<&[u8], &[u8], nom::error::Error<&[u8]>>(b"\0" as &[u8]),
539-
tag(b"\0"),
540+
tag(&b"\0"[..]),
540541
))(parse)
541542
{
542543
Ok((rest, _)) => {
@@ -559,7 +560,7 @@ impl Write for GzipBufWriter {
559560
if self.flags & FCOMMENT != 0 {
560561
match tuple((
561562
take_until::<&[u8], &[u8], nom::error::Error<&[u8]>>(b"\0" as &[u8]),
562-
tag(b"\0"),
563+
tag(&b"\0"[..]),
563564
))(parse)
564565
{
565566
Ok((rest, _)) => {

0 commit comments

Comments
 (0)