diff --git a/cffi_src/factory.go b/cffi_src/factory.go index ad12f001..d3ec18fa 100644 --- a/cffi_src/factory.go +++ b/cffi_src/factory.go @@ -28,6 +28,11 @@ var clients = make(map[string]tls_client.HttpClient) func RemoveSession(sessionId string) { clientsLock.Lock() defer clientsLock.Unlock() + client, ok := clients[sessionId] + if !ok { + return + } + client.CloseIdleConnections() delete(clients, sessionId) }