@@ -155,7 +155,7 @@ fn parse_alpn(alpn: &str) -> Result<Vec<u8>> {
155155}
156156
157157/// Available command line options for configuring relays.
158- #[ derive( Clone , Debug ) ]
158+ #[ derive( Clone , Debug , PartialEq ) ]
159159pub enum RelayModeOption {
160160 /// Disables relays altogether.
161161 Disabled ,
@@ -397,7 +397,9 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> {
397397 let secret_key = get_or_create_secret ( ) ?;
398398 let endpoint = create_endpoint ( secret_key, & args. common , vec ! [ args. common. alpn( ) ?] ) . await ?;
399399 // wait for the endpoint to figure out its address before making a ticket
400- endpoint. home_relay ( ) . initialized ( ) . await ;
400+ if args. common . relay != RelayModeOption :: Disabled {
401+ endpoint. home_relay ( ) . initialized ( ) . await ;
402+ }
401403 let node = endpoint. node_addr ( ) . initialized ( ) . await ;
402404 let mut short = node. clone ( ) ;
403405 let ticket = NodeTicket :: new ( node) ;
@@ -569,7 +571,9 @@ async fn listen_tcp(args: ListenTcpArgs) -> Result<()> {
569571 let secret_key = get_or_create_secret ( ) ?;
570572 let endpoint = create_endpoint ( secret_key, & args. common , vec ! [ args. common. alpn( ) ?] ) . await ?;
571573 // wait for the endpoint to figure out its address before making a ticket
572- endpoint. home_relay ( ) . initialized ( ) . await ;
574+ if args. common . relay != RelayModeOption :: Disabled {
575+ endpoint. home_relay ( ) . initialized ( ) . await ;
576+ }
573577 let node_addr = endpoint. node_addr ( ) . initialized ( ) . await ;
574578 let mut short = node_addr. clone ( ) ;
575579 let ticket = NodeTicket :: new ( node_addr) ;
@@ -651,7 +655,9 @@ async fn listen_unix(args: ListenUnixArgs) -> Result<()> {
651655 let secret_key = get_or_create_secret ( ) ?;
652656 let endpoint = create_endpoint ( secret_key, & args. common , vec ! [ args. common. alpn( ) ?] ) . await ?;
653657 // wait for the endpoint to figure out its address before making a ticket
654- endpoint. home_relay ( ) . initialized ( ) . await ;
658+ if args. common . relay != RelayModeOption :: Disabled {
659+ endpoint. home_relay ( ) . initialized ( ) . await ;
660+ }
655661 let node_addr = endpoint. node_addr ( ) . initialized ( ) . await ;
656662 let mut short = node_addr. clone ( ) ;
657663 let ticket = NodeTicket :: new ( node_addr) ;
0 commit comments