diff --git a/interop/src/main.rs b/interop/src/main.rs index 1dfc78012..4842c5c54 100644 --- a/interop/src/main.rs +++ b/interop/src/main.rs @@ -8,8 +8,10 @@ use tokio::runtime::current_thread::Runtime; use bytes::{Bytes, BytesMut}; use failure::{format_err, Error}; -use quinn_h3::frame::{HeadersFrame, HttpFrame, SettingsFrame}; -use quinn_h3::StreamType; +use quinn_h3::proto::{ + frame::{HeadersFrame, HttpFrame, SettingsFrame}, + StreamType, +}; use slog::{o, warn, Drain, Logger}; type Result = std::result::Result; diff --git a/quinn-h3/src/lib.rs b/quinn-h3/src/lib.rs index f34c2633a..73700f363 100644 --- a/quinn-h3/src/lib.rs +++ b/quinn-h3/src/lib.rs @@ -9,32 +9,5 @@ extern crate proptest; #[macro_use] extern crate assert_matches; -extern crate quinn_proto; -pub mod frame; +pub mod proto; pub mod qpack; - -use bytes::BufMut; -use quinn_proto::coding::BufMutExt; - -pub struct StreamType(u64); - -macro_rules! stream_types { - {$($name:ident = $val:expr,)*} => { - impl StreamType { - $(pub const $name: StreamType = StreamType($val);)* - } - } -} - -stream_types! { - CONTROL = 0x00, - PUSH = 0x01, - ENCODER = 0x02, - DECODER = 0x03, -} - -impl StreamType { - pub fn encode(&self, buf: &mut W) { - buf.write_var(self.0); - } -} diff --git a/quinn-h3/src/frame.rs b/quinn-h3/src/proto/frame.rs similarity index 98% rename from quinn-h3/src/frame.rs rename to quinn-h3/src/proto/frame.rs index 8db1202e4..965e9710d 100644 --- a/quinn-h3/src/frame.rs +++ b/quinn-h3/src/proto/frame.rs @@ -426,6 +426,8 @@ mod tests { HttpFrame::Settings(SettingsFrame { num_placeholders: 0xfada, max_header_list_size: 0xfada, + qpack_max_table_capacity: 0, + qpack_blocked_streams: 0, }) ); } @@ -453,6 +455,8 @@ mod tests { Ok(HttpFrame::Settings(SettingsFrame { num_placeholders: 16, max_header_list_size: 0xFADA, + qpack_max_table_capacity: 0, + qpack_blocked_streams: 0, })) ); } diff --git a/quinn-h3/src/proto/mod.rs b/quinn-h3/src/proto/mod.rs new file mode 100644 index 000000000..72b49e2fa --- /dev/null +++ b/quinn-h3/src/proto/mod.rs @@ -0,0 +1,27 @@ +use bytes::BufMut; +use quinn_proto::coding::BufMutExt; + +pub mod frame; + +pub struct StreamType(u64); + +macro_rules! stream_types { + {$($name:ident = $val:expr,)*} => { + impl StreamType { + $(pub const $name: StreamType = StreamType($val);)* + } + } +} + +stream_types! { + CONTROL = 0x00, + PUSH = 0x01, + ENCODER = 0x02, + DECODER = 0x03, +} + +impl StreamType { + pub fn encode(&self, buf: &mut W) { + buf.write_var(self.0); + } +}