fix(client): handle when DNS resolves after a timeout triggers

Closes #848
This commit is contained in:
Sean McArthur
2016-07-11 15:55:29 -07:00
parent 220d09fc3a
commit 006f66f34a
8 changed files with 131 additions and 115 deletions

View File

@@ -167,8 +167,12 @@ struct Context<F> {
impl<F: HandlerFactory<T>, T: Transport> http::MessageHandlerFactory<(), T> for Context<F> {
type Output = message::Message<F::Output, T>;
fn create(&mut self, seed: http::Seed<()>) -> Self::Output {
message::Message::new(self.factory.create(seed.control()))
fn create(&mut self, seed: http::Seed<()>) -> Option<Self::Output> {
Some(message::Message::new(self.factory.create(seed.control())))
}
fn keep_alive_interest(&self) -> Next {
Next::read()
}
}
@@ -191,7 +195,7 @@ where A: Accept,
rotor_try!(scope.register(&seed, EventSet::readable(), PollOpt::level()));
rotor::Response::ok(
ServerFsm::Conn(
http::Conn::new((), seed, scope.notifier())
http::Conn::new((), seed, Next::read(), scope.notifier())
.keep_alive(scope.keep_alive)
)
)