mirror of
https://github.com/traefik/traefik.git
synced 2025-08-17 03:57:06 +02:00
Make hijackConnectionTracker.Close thread safe
This commit is contained in:
parent
9de3129a55
commit
c5b71592c8
@ -85,6 +85,8 @@ func (h *hijackConnectionTracker) Shutdown(ctx context.Context) error {
|
|||||||
|
|
||||||
// Close close all the connections in the tracked connections list
|
// Close close all the connections in the tracked connections list
|
||||||
func (h *hijackConnectionTracker) Close() {
|
func (h *hijackConnectionTracker) Close() {
|
||||||
|
h.lock.Lock()
|
||||||
|
defer h.lock.Unlock()
|
||||||
for conn := range h.conns {
|
for conn := range h.conns {
|
||||||
if err := conn.Close(); err != nil {
|
if err := conn.Close(); err != nil {
|
||||||
log.Errorf("Error while closing Hijacked conn: %v", err)
|
log.Errorf("Error while closing Hijacked conn: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user