File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -660,7 +660,7 @@ func (e *Echo) Start(address string) error {
660660 return err
661661 }
662662 e .startupMutex .Unlock ()
663- return e .serve ( )
663+ return e .Server . Serve ( e . Listener )
664664}
665665
666666// StartTLS starts an HTTPS server.
@@ -740,8 +740,12 @@ func (e *Echo) StartServer(s *http.Server) (err error) {
740740 e .startupMutex .Unlock ()
741741 return err
742742 }
743+ if s .TLSConfig != nil {
744+ e .startupMutex .Unlock ()
745+ return s .Serve (e .TLSListener )
746+ }
743747 e .startupMutex .Unlock ()
744- return e . serve ( )
748+ return s . Serve ( e . Listener )
745749}
746750
747751func (e * Echo ) configureServer (s * http.Server ) (err error ) {
@@ -782,13 +786,6 @@ func (e *Echo) configureServer(s *http.Server) (err error) {
782786 return nil
783787}
784788
785- func (e * Echo ) serve () error {
786- if e .TLSListener != nil {
787- return e .Server .Serve (e .TLSListener )
788- }
789- return e .Server .Serve (e .Listener )
790- }
791-
792789// ListenerAddr returns net.Addr for Listener
793790func (e * Echo ) ListenerAddr () net.Addr {
794791 e .startupMutex .RLock ()
You can’t perform that action at this time.
0 commit comments