dispatch.rs
Contains an unbounded block loop
SHA-256bed1c86494517677d2f7048ca2a57b44dc636ddcdd9a25db5917155f89e59de3
MaleculeH(Db)
Evidence
1use futures::{Async, AsyncSink, Future, Poll, Sink, Stream};
2use futures::sync::{mpsc, oneshot};
3use tokio_io::{AsyncRead, AsyncWrite};
4use tokio_service::Service;
5
6use super::{Body, Conn, KeepAlive, Http1Transaction, MessageHead, RequestHead, ResponseHead};
7use ::StatusCode;
8
9pub struct Dispatcher<D, Bs, I, B, T, K> {
10 conn: Conn<I, B, T, K>,
11 dispatch: D,
12 b …
52:5… }
53 }
54
55 fn poll_read(&mut self) -> Poll<(), ::Error> {
56 loop {
57 if self.conn.can_read_head() {
58 match self.conn.read_head() {
59 Ok(Async::Ready(So …
67:35… tch.recv_msg(Ok((head, body))).expect("recv_msg with Ok shouldn't error");
68 },
69 Ok(Async::Ready(None)) => {
70 …
76:48… Err(err))?;
77 // if here, the dispatcher gave the user the error
78 // somewhere else. we still need to …
187:26… e_done
188 }
189}
190
191
192impl<D, Bs, I, B, T, K> Future for Dispatcher<D, Bs, I, B, T, K>
193where
194 D: Dispatch<PollItem=MessageHead<T::Outgoing>, PollBody …