Skip to content

Commit 7ff3eec

Browse files
authored
h3-quinn: fix usage of a private StreamId field (#290)
1 parent 04c2b90 commit 7ff3eec

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

h3-quinn/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ license = "MIT"
1515
[dependencies]
1616
h3 = { version = "0.0.7", path = "../h3" }
1717
bytes = "1"
18-
quinn = { version = "0.11", default-features = false, features = [
18+
quinn = { version = "0.11.7", default-features = false, features = [
1919
"futures-io",
2020
] }
2121
tokio-util = { version = "0.7.9" }
@@ -26,4 +26,4 @@ tracing = { version = "0.1.40", optional = true }
2626

2727
[features]
2828
tracing = ["dep:tracing"]
29-
datagram = ["dep:h3-datagram"]
29+
datagram = ["dep:h3-datagram"]

h3-quinn/src/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,9 @@ impl quic::RecvStream for RecvStream {
499499

500500
#[cfg_attr(feature = "tracing", instrument(skip_all, level = "trace"))]
501501
fn recv_id(&self) -> StreamId {
502-
self.stream
503-
.as_ref()
504-
.unwrap()
505-
.id()
506-
.0
507-
.try_into()
508-
.expect("invalid stream id")
502+
let num: u64 = self.stream.as_ref().unwrap().id().into();
503+
504+
num.try_into().expect("invalid stream id")
509505
}
510506
}
511507

@@ -628,7 +624,8 @@ where
628624

629625
#[cfg_attr(feature = "tracing", instrument(skip_all, level = "trace"))]
630626
fn send_id(&self) -> StreamId {
631-
self.stream.id().0.try_into().expect("invalid stream id")
627+
let num: u64 = self.stream.id().into();
628+
num.try_into().expect("invalid stream id")
632629
}
633630
}
634631

h3/src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ where
688688

689689
#[cfg(test)]
690690
mod tests {
691-
use quinn_proto::coding::BufExt;
691+
use crate::proto::coding::BufExt;
692692

693693
use super::*;
694694

0 commit comments

Comments
 (0)