Change the name from "ResponseHeaderTimeout " to "vhost_http_timeout" and Use lowercase letter at the beginning

This commit is contained in:
itcode 2018-08-07 11:02:58 +08:00
parent ecc9e32989
commit a522be2e12
4 changed files with 64 additions and 64 deletions

View File

@ -60,7 +60,7 @@ var (
allowPorts string
maxPoolCount int64
maxPortsPerClient int64
ResponseHeaderTimeout int64
vhostHttpTimeout int64
)
func init() {
@ -86,7 +86,7 @@ func init() {
rootCmd.PersistentFlags().Int64VarP(&authTimeout, "auth_timeout", "", 900, "auth timeout")
rootCmd.PersistentFlags().StringVarP(&subDomainHost, "subdomain_host", "", "", "subdomain host")
rootCmd.PersistentFlags().Int64VarP(&maxPortsPerClient, "max_ports_per_client", "", 0, "max ports per client")
rootCmd.PersistentFlags().Int64VarP(&ResponseHeaderTimeout, "Response_Header_Timeout", "", 30, "Response Header Timeout")
rootCmd.PersistentFlags().Int64VarP(&vhostHttpTimeout, "vhost_http_timeout", "", 30, "vhost http timeout")
}
var rootCmd = &cobra.Command{
@ -179,7 +179,7 @@ func parseServerCommonCfgFromCmd() (err error) {
g.GlbServerCfg.AuthTimeout = authTimeout
g.GlbServerCfg.SubDomainHost = subDomainHost
g.GlbServerCfg.MaxPortsPerClient = maxPortsPerClient
g.GlbServerCfg.ResponseHeaderTimeout = ResponseHeaderTimeout
g.GlbServerCfg.VhostHttpTimeout = vhostHttpTimeout
return
}

View File

@ -67,5 +67,5 @@ subdomain_host = frps.com
# if tcp stream multiplexing is used, default is true
tcp_mux = true
# if Response Header Timeout more the 30s ,fix the pars .
ResponseHeaderTimeout = 30
# if long connection for more than 30 seconds and disconnection of the server ,fix the pars .
vhost_http_timeout = 30

View File

@ -73,7 +73,7 @@ type ServerCommonConf struct {
MaxPortsPerClient int64 `json:"max_ports_per_client"`
HeartBeatTimeout int64 `json:"heart_beat_timeout"`
UserConnTimeout int64 `json:"user_conn_timeout"`
ResponseHeaderTimeout int64 `json:"Response_Header_Timeout"`
VhostHttpTimeout int64 `json:"vhost_http_timeout "`
}
func GetDefaultServerConf() *ServerCommonConf {
@ -103,7 +103,7 @@ func GetDefaultServerConf() *ServerCommonConf {
MaxPortsPerClient: 0,
HeartBeatTimeout: 90,
UserConnTimeout: 10,
ResponseHeaderTimeout: 30,
VhostHttpTimeout: 30,
}
}
@ -302,13 +302,13 @@ func UnmarshalServerConfFromIni(defaultCfg *ServerCommonConf, content string) (c
cfg.HeartBeatTimeout = v
}
}
if tmpStr, ok = conf.Get("common", "Response_Header_Timeout"); ok {
if tmpStr, ok = conf.Get("common", "vhost_http_timeout"); ok {
v, errRet := strconv.ParseInt(tmpStr, 10, 64)
if errRet != nil {
err = fmt.Errorf("Parse conf error: Response_Header_Timeout is incorrect")
err = fmt.Errorf("Parse conf error: vhost_http_timeout is incorrect")
return
} else {
cfg.ResponseHeaderTimeout = v
cfg.VhostHttpTimeout = v
}
}
return

View File

@ -32,7 +32,7 @@ import (
)
var (
responseHeaderTimeout = time.Duration(g.GlbServerCfg.ResponseHeaderTimeout) * time.Second
responseHeaderTimeout = time.Duration(g.GlbServerCfg.VhostHttpTimeout) * time.Second
ErrRouterConfigConflict = errors.New("router config conflict")
ErrNoDomain = errors.New("no such domain")