1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-30 12:00:38 +00:00

update actix version

This commit is contained in:
Nikolay Kim 2018-02-01 01:08:08 -08:00
parent 2b74fbf586
commit eb713bd60e
3 changed files with 10 additions and 10 deletions

View file

@ -169,27 +169,27 @@ impl Handler<Connect> for ClientConnector {
// host name is required // host name is required
if uri.host().is_none() { if uri.host().is_none() {
return Self::reply(Err(ClientConnectorError::InvalidUrl)) return Response::reply(Err(ClientConnectorError::InvalidUrl))
} }
// supported protocols // supported protocols
let proto = match uri.scheme_part() { let proto = match uri.scheme_part() {
Some(scheme) => match Protocol::from(scheme.as_str()) { Some(scheme) => match Protocol::from(scheme.as_str()) {
Some(proto) => proto, Some(proto) => proto,
None => return Self::reply(Err(ClientConnectorError::InvalidUrl)), None => return Response::reply(Err(ClientConnectorError::InvalidUrl)),
}, },
None => return Self::reply(Err(ClientConnectorError::InvalidUrl)), None => return Response::reply(Err(ClientConnectorError::InvalidUrl)),
}; };
// check ssl availability // check ssl availability
if proto.is_secure() && !HAS_OPENSSL { //&& !HAS_TLS { if proto.is_secure() && !HAS_OPENSSL { //&& !HAS_TLS {
return Self::reply(Err(ClientConnectorError::SslIsNotSupported)) return Response::reply(Err(ClientConnectorError::SslIsNotSupported))
} }
let host = uri.host().unwrap().to_owned(); let host = uri.host().unwrap().to_owned();
let port = uri.port().unwrap_or_else(|| proto.port()); let port = uri.port().unwrap_or_else(|| proto.port());
Self::async_reply( Response::async_reply(
Connector::from_registry() Connector::from_registry()
.call(self, ResolveConnect::host_and_port(&host, port)) .call(self, ResolveConnect::host_and_port(&host, port))
.map_err(|_, _, _| ClientConnectorError::Disconnected) .map_err(|_, _, _| ClientConnectorError::Disconnected)

View file

@ -637,14 +637,14 @@ impl<T, A, H, U, V> Handler<StopServer> for HttpServer<T, A, H, U>
} }
if !self.workers.is_empty() { if !self.workers.is_empty() {
Self::async_reply( Response::async_reply(
rx.into_future().map(|_| ()).map_err(|_| ()).actfuture()) rx.into_future().map(|_| ()).map_err(|_| ()).actfuture())
} else { } else {
// we need to stop system if server was spawned // we need to stop system if server was spawned
if self.exit { if self.exit {
Arbiter::system().send(actix::msgs::SystemExit(0)) Arbiter::system().send(actix::msgs::SystemExit(0))
} }
Self::reply(Ok(())) Response::reply(Ok(()))
} }
} }
} }

View file

@ -124,16 +124,16 @@ impl<H> Handler<StopWorker> for Worker<H>
let num = self.settings.num_channels(); let num = self.settings.num_channels();
if num == 0 { if num == 0 {
info!("Shutting down http worker, 0 connections"); info!("Shutting down http worker, 0 connections");
Self::reply(Ok(true)) Response::reply(Ok(true))
} else if let Some(dur) = msg.graceful { } else if let Some(dur) = msg.graceful {
info!("Graceful http worker shutdown, {} connections", num); info!("Graceful http worker shutdown, {} connections", num);
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
self.shutdown_timeout(ctx, tx, dur); self.shutdown_timeout(ctx, tx, dur);
Self::async_reply(rx.map_err(|_| ()).actfuture()) Response::async_reply(rx.map_err(|_| ()).actfuture())
} else { } else {
info!("Force shutdown http worker, {} connections", num); info!("Force shutdown http worker, {} connections", num);
self.settings.head().traverse::<TcpStream, H>(); self.settings.head().traverse::<TcpStream, H>();
Self::reply(Ok(false)) Response::reply(Ok(false))
} }
} }
} }