@@ -17,15 +17,14 @@ import (
17
17
18
18
// Listener represents an HTTP listener.
19
19
type Listener struct {
20
- URL * url.URL
21
- protocol string
22
- localAddress string
23
- tlsLocalAddress string
24
- endpoints []string
25
- active bool
26
- listener net.Listener
27
- tlsListener net.Listener
28
- mux * http.ServeMux
20
+ URL * url.URL
21
+ protocol string
22
+ localAddress string
23
+ endpoints []string
24
+ active bool
25
+ listener net.Listener
26
+ tlsListener net.Listener
27
+ mux * http.ServeMux
29
28
}
30
29
31
30
// NewListener creates a new Listener.
@@ -56,7 +55,6 @@ func (l *Listener) StartTLS(errChan chan<- error, tlsConfig *tls.Config, address
56
55
}
57
56
58
57
l .tlsListener = list
59
- l .tlsLocalAddress = address
60
58
log .Printf ("[Listener] Started listening on tls endpoint %s." , address )
61
59
62
60
// Launch goroutine for servicing https requests
@@ -102,15 +100,15 @@ func (l *Listener) Stop() {
102
100
if l .tlsListener != nil {
103
101
// Stop servicing requests on secure listener
104
102
_ = l .tlsListener .Close ()
105
- log .Printf ("[Listener] Stopped listening on tls endpoint %s" , l .tlsLocalAddress )
103
+ log .Printf ("[Listener] Stopped listening on tls endpoint %s" , l .tlsListener . Addr () )
106
104
}
107
105
108
106
// Delete the unix socket.
109
107
if l .protocol == "unix" {
110
108
_ = os .Remove (l .localAddress )
111
109
}
112
110
113
- log .Printf ("[Listener] Stopped listening on %s" , l .localAddress )
111
+ log .Printf ("[Listener] Stopped listening on %s" , l .listener . Addr () )
114
112
}
115
113
116
114
// GetMux returns the HTTP mux for the listener.
0 commit comments