narrow the surface area of the ControlSettings api to expose only a few remote settings

This commit is contained in:
Oliver Gould
2017-07-23 18:32:22 +00:00
parent 82ba0dde71
commit df5f31a63c
8 changed files with 110 additions and 74 deletions

View File

@@ -46,12 +46,13 @@ pub fn handshake2<T, B: IntoBuf>(io: T) -> Handshake<T, B>
where T: AsyncRead + AsyncWrite + 'static,
B: 'static, // TODO: Why is this required but not in client?
{
let transport = proto::server_handshaker(io, Default::default());
let local_settings = frame::SettingSet::default();
let transport = proto::server_handshaker(io, local_settings.clone());
// Flush pending settings frame and then wait for the client preface
let handshake = Flush::new(transport)
.and_then(ReadPreface::new)
.map(proto::from_server_handshaker)
.map(move |t| proto::from_server_handshaker(t, local_settings))
;
Handshake { inner: Box::new(handshake) }