fix(client): Handle connection error

Previously, the connection would be kept alive if there was a connect
error. Now it's closed immediately.
This commit is contained in:
Joe Wilm
2016-10-11 14:20:30 -07:00
parent 27a480c327
commit ef4c08c9e9

View File

@@ -483,11 +483,11 @@ where C: Connect,
if let Some(err) = seed.1.take_socket_error().err() {
debug!("error while connecting: {:?}", err);
scope.pop_queue(&seed.0).map(move |mut queued| queued.handler.on_error(::Error::Io(err)));
rotor::Response::done()
} else {
trace!("connecting is_error, but no socket error");
rotor::Response::ok(ClientFsm::Connecting(seed))
}
rotor::Response::done()
} else if events.is_writable() {
if scope.queue.contains_key(&seed.0) {
trace!("connected and writable {:?}", seed.0);