Get settings handshake working + other junk

This commit is contained in:
Carl Lerche
2017-06-23 15:51:00 -07:00
parent fa21970656
commit ac2959e956
4 changed files with 44 additions and 19 deletions

View File

@@ -78,7 +78,23 @@ impl<T> Stream for Settings<T>
type Error = ConnectionError;
fn poll(&mut self) -> Poll<Option<Frame>, ConnectionError> {
self.inner.poll()
loop {
match try_ready!(self.inner.poll()) {
Some(Frame::Settings(v)) => {
if v.is_ack() {
debug!("received remote settings ack");
// TODO: Handle acks
} else {
// Received new settings, queue an ACK
self.remaining_acks += 1;
// Save off the settings
self.remote = v.into_set();
}
}
v => return Ok(Async::Ready(v)),
}
}
}
}