@@ -16,9 +16,7 @@ use futures_core::Stream;
1616use futures_util:: { FutureExt , TryFutureExt } ;
1717use hmac:: { Hmac , Mac } ;
1818use http_body_util:: { BodyExt , Full } ;
19- use hyper:: {
20- body:: Incoming , Method , Request , Response , StatusCode
21- } ;
19+ use hyper:: { body:: Incoming , Method , Request , Response , StatusCode } ;
2220
2321use hyper_util:: { rt:: TokioIo , server:: graceful:: GracefulShutdown } ;
2422use log:: { debug, error, warn} ;
@@ -246,7 +244,7 @@ impl DiscoveryServer {
246244 pub fn new ( config : Config , port : & mut u16 ) -> Result < Self , Error > {
247245 let ( discovery, cred_rx) = RequestHandler :: new ( config) ;
248246 let address = SocketAddr :: new ( Ipv4Addr :: UNSPECIFIED . into ( ) , * port) ;
249-
247+
250248 let ( close_tx, close_rx) = oneshot:: channel ( ) ;
251249
252250 let listener = match TcpListener :: bind ( address) {
@@ -271,10 +269,9 @@ impl DiscoveryServer {
271269 }
272270 }
273271
274-
275272 tokio:: spawn ( async move {
276273 let discovery = Arc :: new ( discovery) ;
277-
274+
278275 let server = hyper:: server:: conn:: http1:: Builder :: new ( ) ;
279276 let graceful = GracefulShutdown :: new ( ) ;
280277 let mut close_rx = std:: pin:: pin!( close_rx) ;
0 commit comments