Make DialTimeout configurable.

This commit is contained in:
NI
2019-08-12 23:50:24 +08:00
parent db633f59bd
commit f3336d61a0
17 changed files with 173 additions and 119 deletions

View File

@@ -80,7 +80,6 @@ func (s Server) Serve(
closeCallback CloseCallback,
handlerBuilder HandlerBuilder,
) *Serving {
ccCfg := commonCfg.WithDefault()
ssCfg := serverCfg.WithDefault()
l := s.logger.Context(
@@ -88,7 +87,7 @@ func (s Server) Serve(
ss := &Serving{
server: http.Server{
Handler: handlerBuilder(ccCfg, ssCfg, l),
Handler: handlerBuilder(commonCfg, ssCfg, l),
ReadTimeout: ssCfg.ReadTimeout,
ReadHeaderTimeout: ssCfg.InitialTimeout,
WriteTimeout: ssCfg.WriteTimeout,