Blob Blame History Raw
From 4c1631fc239d2f0b8323b48e5fa95b0dc6f75f40 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Wed, 7 Oct 2020 08:31:59 +0200
Subject: [PATCH 1/2] Explicitly close TCP connections after use

---
 pcsd/pcs.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pcsd/pcs.rb b/pcsd/pcs.rb
index 12eb3eb1..c59de37b 100644
--- a/pcsd/pcs.rb
+++ b/pcsd/pcs.rb
@@ -515,8 +515,11 @@ def send_request(
   })
   req.compose_header('Expect', '')
   return_code = req.perform
+  response_code = req.response_code
+  response_body = req.response_body
+  req.cleanup
   if return_code == :ok
-    return req.response_code, req.response_body
+    return response_code, response_body
   else
     if is_proxy_set(ENV)
       $logger.warn(
-- 
2.21.0