More tweaks

This commit is contained in:
Carl Lerche
2017-08-10 20:35:41 -07:00
parent 10fd4ae7ed
commit e2fac3e823
2 changed files with 4 additions and 3 deletions

View File

@@ -136,7 +136,8 @@ impl<T> FramedRead<T> {
} }
} }
Kind::Unknown => { Kind::Unknown => {
unimplemented!() // Unknown frames are ignored
return Ok(None);
} }
}; };

View File

@@ -281,8 +281,8 @@ impl<T: AsyncRead> Future for ReadPreface<T> {
let n = try_nb!(self.inner.as_mut().unwrap().read(&mut buf[..rem])); let n = try_nb!(self.inner.as_mut().unwrap().read(&mut buf[..rem]));
if PREFACE[self.pos..self.pos+n] != buf[..n] { if PREFACE[self.pos..self.pos+n] != buf[..n] {
// TODO: Invalid connection preface // TODO: Should this just write the GO_AWAY frame directly?
unimplemented!(); return Err(ProtocolError.into());
} }
self.pos += n; self.pos += n;