lint: Http -> HTTP
This commit is contained in:
parent
a78fac6d7f
commit
0ecd126ae8
2 changed files with 10 additions and 10 deletions
|
@ -91,9 +91,9 @@ type TrackerConfig struct {
|
||||||
type HTTPConfig struct {
|
type HTTPConfig struct {
|
||||||
ListenAddr string `json:"http_listen_addr"`
|
ListenAddr string `json:"http_listen_addr"`
|
||||||
RequestTimeout Duration `json:"http_request_timeout"`
|
RequestTimeout Duration `json:"http_request_timeout"`
|
||||||
HttpReadTimeout Duration `json:"http_read_timeout"`
|
HTTPReadTimeout Duration `json:"http_read_timeout"`
|
||||||
HttpWriteTimeout Duration `json:"http_write_timeout"`
|
HTTPWriteTimeout Duration `json:"http_write_timeout"`
|
||||||
HttpListenLimit int `json:"http_listen_limit"`
|
HTTPListenLimit int `json:"http_listen_limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config is the global configuration for an instance of Chihaya.
|
// Config is the global configuration for an instance of Chihaya.
|
||||||
|
@ -129,8 +129,8 @@ var DefaultConfig = Config{
|
||||||
HTTPConfig: HTTPConfig{
|
HTTPConfig: HTTPConfig{
|
||||||
ListenAddr: ":6881",
|
ListenAddr: ":6881",
|
||||||
RequestTimeout: Duration{10 * time.Second},
|
RequestTimeout: Duration{10 * time.Second},
|
||||||
HttpReadTimeout: Duration{10 * time.Second},
|
HTTPReadTimeout: Duration{10 * time.Second},
|
||||||
HttpWriteTimeout: Duration{10 * time.Second},
|
HTTPWriteTimeout: Duration{10 * time.Second},
|
||||||
},
|
},
|
||||||
|
|
||||||
DriverConfig: DriverConfig{
|
DriverConfig: DriverConfig{
|
||||||
|
|
10
http/http.go
10
http/http.go
|
@ -127,19 +127,19 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(0).Info("Starting on ", cfg.ListenAddr)
|
glog.V(0).Info("Starting on ", cfg.ListenAddr)
|
||||||
if cfg.HttpListenLimit != 0 {
|
if cfg.HTTPListenLimit != 0 {
|
||||||
glog.V(0).Info("Limiting connections to ", cfg.HttpListenLimit)
|
glog.V(0).Info("Limiting connections to ", cfg.HTTPListenLimit)
|
||||||
}
|
}
|
||||||
|
|
||||||
grace := &graceful.Server{
|
grace := &graceful.Server{
|
||||||
Timeout: cfg.RequestTimeout.Duration,
|
Timeout: cfg.RequestTimeout.Duration,
|
||||||
ConnState: srv.connState,
|
ConnState: srv.connState,
|
||||||
ListenLimit: cfg.HttpListenLimit,
|
ListenLimit: cfg.HTTPListenLimit,
|
||||||
Server: &http.Server{
|
Server: &http.Server{
|
||||||
Addr: cfg.ListenAddr,
|
Addr: cfg.ListenAddr,
|
||||||
Handler: newRouter(srv),
|
Handler: newRouter(srv),
|
||||||
ReadTimeout: cfg.HttpReadTimeout.Duration,
|
ReadTimeout: cfg.HTTPReadTimeout.Duration,
|
||||||
WriteTimeout: cfg.HttpWriteTimeout.Duration,
|
WriteTimeout: cfg.HTTPWriteTimeout.Duration,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue