@@ -117,18 +117,18 @@ func (srv *Server) start() error {
117117 State : srv .state ,
118118 })
119119 }
120-
121120 if srv .state == StateClosed {
122121 srv .httpServer = http.Server {
123- DisableGeneralOptionsHandler : srv .httpServer . DisableGeneralOptionsHandler ,
124- TLSConfig : srv .httpServer . TLSConfig ,
125- TLSNextProto : srv .httpServer . TLSNextProto ,
126- ConnState : srv .httpServer . ConnState ,
127- ErrorLog : srv .httpServer . ErrorLog ,
128- BaseContext : srv .httpServer . BaseContext ,
129- ConnContext : srv .httpServer . ConnContext ,
122+ DisableGeneralOptionsHandler : srv .DisableGeneralOptionsHandler ,
123+ TLSConfig : srv .TLSConfig ,
124+ TLSNextProto : srv .TLSNextProto ,
125+ ConnState : srv .ConnState ,
126+ ErrorLog : srv .ErrorLog ,
127+ BaseContext : srv .BaseContext ,
128+ ConnContext : srv .ConnContext ,
130129 }
131130 }
131+
132132 if srv .log == nil {
133133 srv .log = NopLogger ()
134134 }
@@ -232,9 +232,9 @@ func (srv *Server) isClosed(err error) (ok bool) {
232232// error when the server is closed.
233233func (srv * Server ) Run () error {
234234 srv .mut .RLock ()
235- useTLS := srv .httpServer . TLSConfig != nil &&
236- (len (srv .httpServer . TLSConfig .Certificates ) != 0 ||
237- srv .httpServer . TLSConfig .GetCertificate != nil )
235+ useTLS := srv .TLSConfig != nil &&
236+ (len (srv .TLSConfig .Certificates ) != 0 ||
237+ srv .TLSConfig .GetCertificate != nil )
238238 srv .mut .RUnlock ()
239239
240240 var err error
@@ -270,7 +270,7 @@ func (srv *Server) Shutdown(ctx context.Context) error {
270270 srv .mut .Lock ()
271271 srv .state = StateClosing
272272 srv .log .LogServerShutdown (srv .name )
273- srv .httpServer . SetKeepAlivesEnabled (false )
273+ srv .SetKeepAlivesEnabled (false )
274274 shutdownTimeout := srv .Config .ShutdownTimeout
275275 srv .mut .Unlock ()
276276
0 commit comments