格式调整

This commit is contained in:
nkbai 2015-12-09 09:03:10 +08:00
parent 82e0105d22
commit e8fe859a58
1 changed files with 13 additions and 13 deletions

View File

@ -53,18 +53,18 @@ import (
) )
const ( const (
// PreSignal is the position to add filter before signal // PreSignal is the position to add filter before signal
PreSignal = iota PreSignal = iota
// PostSignal is the position to add filter after signal // PostSignal is the position to add filter after signal
PostSignal PostSignal
// StateInit represent the application inited // StateInit represent the application inited
StateInit StateInit
// StateRunning represent the application is running // StateRunning represent the application is running
StateRunning StateRunning
// StateShuttingDown represent the application is shutting down // StateShuttingDown represent the application is shutting down
StateShuttingDown StateShuttingDown
// StateTerminate represent the application is killed // StateTerminate represent the application is killed
StateTerminate StateTerminate
) )
@ -75,25 +75,25 @@ var (
socketPtrOffsetMap map[string]uint socketPtrOffsetMap map[string]uint
runningServersForked bool runningServersForked bool
// DefaultReadTimeOut is the HTTP read timeout // DefaultReadTimeOut is the HTTP read timeout
DefaultReadTimeOut time.Duration DefaultReadTimeOut time.Duration
// DefaultWriteTimeOut is the HTTP Write timeout // DefaultWriteTimeOut is the HTTP Write timeout
DefaultWriteTimeOut time.Duration DefaultWriteTimeOut time.Duration
// DefaultMaxHeaderBytes is the Max HTTP Herder size, default is 0, no limit // DefaultMaxHeaderBytes is the Max HTTP Herder size, default is 0, no limit
DefaultMaxHeaderBytes int DefaultMaxHeaderBytes int
// DefaultTimeout is the shutdown server's timeout. default is 60s // DefaultTimeout is the shutdown server's timeout. default is 60s
DefaultTimeout time.Duration DefaultTimeout time.Duration
isChild bool isChild bool
socketOrder string socketOrder string
once sync.Once=sync.Once{} once sync.Once
) )
func init() { func init() {
DefaultMaxHeaderBytes = 0 DefaultMaxHeaderBytes = 0
DefaultTimeout = 60 * time.Second DefaultTimeout = 60 * time.Second
} }
func onceInit(){ func onceInit() {
regLock = &sync.Mutex{} regLock = &sync.Mutex{}
flag.BoolVar(&isChild, "graceful", false, "listen on open fd (after forking)") flag.BoolVar(&isChild, "graceful", false, "listen on open fd (after forking)")
flag.StringVar(&socketOrder, "socketorder", "", "previous initialization order - used when more than one listener was started") flag.StringVar(&socketOrder, "socketorder", "", "previous initialization order - used when more than one listener was started")