mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 02:09:47 +08:00
checkDirectives must've slipped through the cracks in big merge
Also we're not messing with log flags anymore during parsing. Timestamps could come in handy, plus concurrent logging is going on now.
This commit is contained in:
parent
bcea5182c6
commit
d34e92ee70
|
@ -29,10 +29,6 @@ const (
|
|||
func loadConfigs(filename string, input io.Reader) ([]server.Config, error) {
|
||||
var configs []server.Config
|
||||
|
||||
// turn off timestamp for parsing
|
||||
flags := log.Flags()
|
||||
log.SetFlags(0)
|
||||
|
||||
// Each server block represents similar hosts/addresses, since they
|
||||
// were grouped together in the Caddyfile.
|
||||
serverBlocks, err := parse.ServerBlocks(filename, input, true)
|
||||
|
@ -168,9 +164,6 @@ func loadConfigs(filename string, input io.Reader) ([]server.Config, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// restore logging settings
|
||||
log.SetFlags(flags)
|
||||
|
||||
return configs, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import "io"
|
|||
// in the order in which they appear.
|
||||
func ServerBlocks(filename string, input io.Reader, checkDirectives bool) ([]serverBlock, error) {
|
||||
p := parser{Dispenser: NewDispenser(filename, input)}
|
||||
p.checkDirectives = checkDirectives
|
||||
blocks, err := p.parseAll()
|
||||
return blocks, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user