Make hijackConnectionTracker.Close thread safe

This commit is contained in:
Julien Levesy 2019-08-12 11:34:05 +02:00 committed by Traefiker Bot
parent 9de3129a55
commit c5b71592c8

View File

@ -85,6 +85,8 @@ func (h *hijackConnectionTracker) Shutdown(ctx context.Context) error {
// Close close all the connections in the tracked connections list
func (h *hijackConnectionTracker) Close() {
h.lock.Lock()
defer h.lock.Unlock()
for conn := range h.conns {
if err := conn.Close(); err != nil {
log.Errorf("Error while closing Hijacked conn: %v", err)