Skip to content

Commit

Permalink
chore: add log for stopping the TLS listener
Browse files Browse the repository at this point in the history
  • Loading branch information
jackieluc committed Jun 6, 2024
1 parent df89cc3 commit 78d5fbc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions common/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import (

// Listener represents an HTTP listener.
type Listener struct {
URL *url.URL
protocol string
localAddress string
endpoints []string
active bool
listener net.Listener
tlsListener net.Listener
mux *http.ServeMux
URL *url.URL
protocol string
localAddress string
tlsLocalAddress string
endpoints []string
active bool
listener net.Listener
tlsListener net.Listener
mux *http.ServeMux
}

// NewListener creates a new Listener.
Expand Down Expand Up @@ -55,6 +56,7 @@ func (l *Listener) StartTLS(errChan chan<- error, tlsConfig *tls.Config, address
}

l.tlsListener = list
l.tlsLocalAddress = address
log.Printf("[Listener] Started listening on tls endpoint %s.", address)

// Launch goroutine for servicing https requests
Expand Down Expand Up @@ -100,6 +102,7 @@ func (l *Listener) Stop() {
if l.tlsListener != nil {
// Stop servicing requests on secure listener
_ = l.tlsListener.Close()
log.Printf("[Listener] Stopped listening on tls endpoint %s", l.tlsLocalAddress)
}

// Delete the unix socket.
Expand Down

0 comments on commit 78d5fbc

Please sign in to comment.