From 021395f7cbecda233fea4747238f9ea92607b538 Mon Sep 17 00:00:00 2001 From: JohnDoe117 Date: Fri, 8 Dec 2023 10:04:42 +0800 Subject: [PATCH] when RemoveSession close HttpClient when RemoveSession close HttpClient --- cffi_src/factory.go | 5 +++++ 1 file changed, 5 insertions(+) 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) }