From b4c59662ac466e4f1cf3d221c7753ad1508c3c1a Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 10 十一月 2021 16:03:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
index 71bb317..2c95216 100644
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
@@ -14,6 +14,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.TimeUnit;
 
 @Component
 public class ZLMRESTfulUtils {
@@ -54,6 +55,9 @@
                         if (responseStr != null) {
                             responseJSON = JSON.parseObject(responseStr);
                         }
+                    }else {
+                        response.close();
+                        Objects.requireNonNull(response.body()).close();
                     }
                 } catch (ConnectException e) {
                     logger.error(String.format("杩炴帴ZLM澶辫触: %s, %s", e.getCause().getMessage(), e.getMessage()));
@@ -73,6 +77,10 @@
                             } catch (IOException e) {
                                 logger.error(String.format("[ %s ]璇锋眰澶辫触: %s", url, e.getMessage()));
                             }
+
+                        }else {
+                            response.close();
+                            Objects.requireNonNull(response.body()).close();
                         }
                     }
 
@@ -138,9 +146,15 @@
 
     public JSONObject getMediaList(MediaServerItem mediaServerItem, String app, String stream, String schema, RequestCallback callback){
         Map<String, Object> param = new HashMap<>();
-        if (app != null) param.put("app",app);
-        if (stream != null) param.put("stream",stream);
-        if (schema != null) param.put("schema",schema);
+        if (app != null) {
+            param.put("app",app);
+        }
+        if (stream != null) {
+            param.put("stream",stream);
+        }
+        if (schema != null) {
+            param.put("schema",schema);
+        }
         param.put("vhost","__defaultVhost__");
         return sendPost(mediaServerItem, "getMediaList",param, callback);
     }

--
Gitblit v1.8.0