Actually get server working (maybe)

This commit is contained in:
Carl Lerche
2017-08-09 10:49:49 -07:00
parent 8f2b69c280
commit f39e983af0
4 changed files with 16 additions and 9 deletions

View File

@@ -132,18 +132,17 @@ impl<B> Recv<B> where B: Buf {
self.inc_num_streams();
}
// Push the frame onto the stream's recv buffer
stream.pending_recv.push_back(&mut self.buffer, frame.into());
stream.notify_recv();
// Only servers can receive a headers frame that initiates the stream.
// This is verified in `Streams` before calling this function.
if P::is_server() {
self.pending_accept.push(stream);
Ok(())
} else {
// Push the frame onto the recv buffer
stream.pending_recv.push_back(&mut self.buffer, frame.into());
stream.notify_recv();
Ok(())
}
Ok(())
}
pub fn recv_eos(&mut self, stream: &mut Stream<B>)

View File

@@ -112,6 +112,7 @@ impl<T, B> futures::Stream for Server<T, B>
}
if let Some(inner) = self.connection.next_incoming() {
trace!("received incoming");
let (head, _) = inner.take_request()?.into_parts();
let body = Body { inner: inner.clone() };