forked from External/ergo
rename some variables for clarity
This commit is contained in:
parent
50783d5276
commit
7432ef07a7
3 changed files with 16 additions and 16 deletions
|
|
@ -54,10 +54,10 @@ type listenerConfigBlock struct {
|
|||
// listenerConfig is the config governing a particular listener (bound address),
|
||||
// in particular whether it has TLS or Tor (or both) enabled.
|
||||
type listenerConfig struct {
|
||||
TLSConfig *tls.Config
|
||||
IsTor bool
|
||||
IsSTSOnly bool
|
||||
IsTLSProxy bool
|
||||
TLSConfig *tls.Config
|
||||
Tor bool
|
||||
STSOnly bool
|
||||
ProxyBeforeTLS bool
|
||||
}
|
||||
|
||||
type AccountConfig struct {
|
||||
|
|
@ -520,9 +520,9 @@ func (conf *Config) prepareListeners() (err error) {
|
|||
if 0 < len(conf.Server.Listeners) {
|
||||
for addr, block := range conf.Server.Listeners {
|
||||
var lconf listenerConfig
|
||||
lconf.IsTor = block.Tor
|
||||
lconf.IsSTSOnly = block.STSOnly
|
||||
if lconf.IsSTSOnly && !conf.Server.STS.Enabled {
|
||||
lconf.Tor = block.Tor
|
||||
lconf.STSOnly = block.STSOnly
|
||||
if lconf.STSOnly && !conf.Server.STS.Enabled {
|
||||
return fmt.Errorf("%s is configured as a STS-only listener, but STS is disabled", addr)
|
||||
}
|
||||
if block.TLS.Cert != "" {
|
||||
|
|
@ -531,7 +531,7 @@ func (conf *Config) prepareListeners() (err error) {
|
|||
return err
|
||||
}
|
||||
lconf.TLSConfig = tlsConfig
|
||||
lconf.IsTLSProxy = block.TLS.Proxy
|
||||
lconf.ProxyBeforeTLS = block.TLS.Proxy
|
||||
}
|
||||
listeners[addr] = lconf
|
||||
}
|
||||
|
|
@ -544,7 +544,7 @@ func (conf *Config) prepareListeners() (err error) {
|
|||
}
|
||||
for _, addr := range conf.Server.Listen {
|
||||
var lconf listenerConfig
|
||||
lconf.IsTor = torListeners[addr]
|
||||
lconf.Tor = torListeners[addr]
|
||||
tlsListenConf, ok := conf.Server.TLSListeners[addr]
|
||||
if ok {
|
||||
tlsConfig, err := loadTlsConfig(tlsListenConf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue