Skip to content

Commit 6fa6b81

Browse files
read transport parameter
1 parent 86825ee commit 6fa6b81

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

quinn-proto/src/connection/paths.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ pub struct PathId(pub(crate) u32);
2020
impl coding::Codec for PathId {
2121
fn decode<B: bytes::Buf>(r: &mut B) -> coding::Result<Self> {
2222
let v = VarInt::decode(r)?;
23-
// TODO(@flub): Mapping this error is not nice, maybe the error type should have 2
24-
// variants.
2523
let v = u32::try_from(v.0).map_err(|_| coding::UnexpectedEnd)?;
26-
Ok(Self(v as u32))
24+
Ok(Self(v))
2725
}
2826

2927
fn encode<B: bytes::BufMut>(&self, w: &mut B) {
30-
VarInt(self.0 as u64).encode(w)
28+
VarInt(self.0.into()).encode(w)
3129
}
3230
}
3331

quinn-proto/src/transport_parameters.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ impl TryFrom<u64> for TransportParameterId {
773773
id if Self::GreaseQuicBit == id => Self::GreaseQuicBit,
774774
id if Self::MinAckDelayDraft07 == id => Self::MinAckDelayDraft07,
775775
id if Self::ObservedAddr == id => Self::ObservedAddr,
776+
id if Self::InitialMaxPathId == id => Self::InitialMaxPathId,
776777
_ => return Err(()),
777778
};
778779
Ok(param)

0 commit comments

Comments
 (0)