Update dns-proxy flag name
Also remove `MaxUpstreamConnsFlag` const as it's no longer referenced in more than one place and to make things more consistent with how the other flags are referenced.
This commit is contained in:
		
							parent
							
								
									198e1b6a34
								
							
						
					
					
						commit
						d8afda7408
					
				|  | @ -1004,7 +1004,7 @@ func configureProxyDNSFlags(shouldHide bool) []cli.Flag { | ||||||
| 			Hidden:  shouldHide, | 			Hidden:  shouldHide, | ||||||
| 		}), | 		}), | ||||||
| 		altsrc.NewIntFlag(&cli.IntFlag{ | 		altsrc.NewIntFlag(&cli.IntFlag{ | ||||||
| 			Name:    tunneldns.MaxUpstreamConnsFlag, | 			Name:    "proxy-dns-max-upstream-conns", | ||||||
| 			Usage:   "Maximum concurrent connections to upstream. Setting to 0 means unlimited.", | 			Usage:   "Maximum concurrent connections to upstream. Setting to 0 means unlimited.", | ||||||
| 			Value:   tunneldns.MaxUpstreamConnsDefault, | 			Value:   tunneldns.MaxUpstreamConnsDefault, | ||||||
| 			Hidden:  shouldHide, | 			Hidden:  shouldHide, | ||||||
|  |  | ||||||
|  | @ -15,9 +15,9 @@ func runDNSProxyServer(c *cli.Context, dnsReadySignal, shutdownC chan struct{}, | ||||||
| 	if port <= 0 || port > 65535 { | 	if port <= 0 || port > 65535 { | ||||||
| 		return errors.New("The 'proxy-dns-port' must be a valid port number in <1, 65535> range.") | 		return errors.New("The 'proxy-dns-port' must be a valid port number in <1, 65535> range.") | ||||||
| 	} | 	} | ||||||
| 	maxUpstreamConnections := c.Int(tunneldns.MaxUpstreamConnsFlag) | 	maxUpstreamConnections := c.Int("proxy-dns-max-upstream-conns") | ||||||
| 	if maxUpstreamConnections < 0 { | 	if maxUpstreamConnections < 0 { | ||||||
| 		return fmt.Errorf("'%s' must be 0 or higher", tunneldns.MaxUpstreamConnsFlag) | 		return fmt.Errorf("'%s' must be 0 or higher", "proxy-dns-max-upstream-conns") | ||||||
| 	} | 	} | ||||||
| 	listener, err := tunneldns.CreateListener(c.String("proxy-dns-address"), uint16(port), c.StringSlice("proxy-dns-upstream"), c.StringSlice("proxy-dns-bootstrap"), maxUpstreamConnections, log) | 	listener, err := tunneldns.CreateListener(c.String("proxy-dns-address"), uint16(port), c.StringSlice("proxy-dns-upstream"), c.StringSlice("proxy-dns-bootstrap"), maxUpstreamConnections, log) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  |  | ||||||
|  | @ -23,7 +23,6 @@ import ( | ||||||
| const ( | const ( | ||||||
| 	LogFieldAddress         = "address" | 	LogFieldAddress         = "address" | ||||||
| 	LogFieldURL             = "url" | 	LogFieldURL             = "url" | ||||||
| 	MaxUpstreamConnsFlag    = "max-upstream-conns" |  | ||||||
| 	MaxUpstreamConnsDefault = 5 | 	MaxUpstreamConnsDefault = 5 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -71,7 +70,7 @@ func Command(hidden bool) *cli.Command { | ||||||
| 				EnvVars: []string{"TUNNEL_DNS_BOOTSTRAP"}, | 				EnvVars: []string{"TUNNEL_DNS_BOOTSTRAP"}, | ||||||
| 			}, | 			}, | ||||||
| 			&cli.IntFlag{ | 			&cli.IntFlag{ | ||||||
| 				Name:    MaxUpstreamConnsFlag, | 				Name:    "max-upstream-conns", | ||||||
| 				Usage:   "Maximum concurrent connections to upstream. Setting to 0 means unlimited.", | 				Usage:   "Maximum concurrent connections to upstream. Setting to 0 means unlimited.", | ||||||
| 				Value:   MaxUpstreamConnsDefault, | 				Value:   MaxUpstreamConnsDefault, | ||||||
| 				EnvVars: []string{"TUNNEL_DNS_MAX_UPSTREAM_CONNS"}, | 				EnvVars: []string{"TUNNEL_DNS_MAX_UPSTREAM_CONNS"}, | ||||||
|  | @ -98,7 +97,7 @@ func Run(c *cli.Context) error { | ||||||
| 		uint16(c.Uint("port")), | 		uint16(c.Uint("port")), | ||||||
| 		c.StringSlice("upstream"), | 		c.StringSlice("upstream"), | ||||||
| 		c.StringSlice("bootstrap"), | 		c.StringSlice("bootstrap"), | ||||||
| 		c.Int(MaxUpstreamConnsFlag), | 		c.Int("max-upstream-conns"), | ||||||
| 		log, | 		log, | ||||||
| 	) | 	) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue