File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ func (p *Server) Start() error {
5555 if p .isStarted () {
5656 return nil
5757 }
58- p .started .Store (true )
5958
6059 // Start HTTP server with custom listener for TLS detection
6160 go func () {
@@ -82,6 +81,8 @@ func (p *Server) Start() error {
8281 }
8382 }()
8483
84+ p .started .Store (true )
85+
8586 return nil
8687}
8788
@@ -93,12 +94,14 @@ func (p *Server) Stop() error {
9394 p .started .Store (false )
9495
9596 if p .listener == nil {
96- return errors .New ("listener is nil; server was not started" )
97+ p .logger .Error ("unexpected nil listener" )
98+ return errors .New ("unexpected nil listener" )
9799 }
98100
99101 err := p .listener .Close ()
100102 if err != nil {
101103 p .logger .Error ("Failed to close listener" , "error" , err )
104+ return err
102105 }
103106
104107 return nil
You can’t perform that action at this time.
0 commit comments