feat(http2): Implement Client-side CONNECT support over HTTP/2 (#2523)
Closes #2508
This commit is contained in:
@@ -3,6 +3,17 @@ use std::fmt;
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub(crate) struct DecodedLength(u64);
|
||||
|
||||
#[cfg(any(feature = "http1", feature = "http2"))]
|
||||
impl From<Option<u64>> for DecodedLength {
|
||||
fn from(len: Option<u64>) -> Self {
|
||||
len.and_then(|len| {
|
||||
// If the length is u64::MAX, oh well, just reported chunked.
|
||||
Self::checked_new(len).ok()
|
||||
})
|
||||
.unwrap_or(DecodedLength::CHUNKED)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "http1", feature = "http2", test))]
|
||||
const MAX_LEN: u64 = std::u64::MAX - 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user