From 3e5e8a900bbf393c91c7f431bf318dd87537c1a7 Mon Sep 17 00:00:00 2001
From: 648540858 <456PANlinlin>
Date: 星期一, 15 十一月 2021 23:02:19 +0800
Subject: [PATCH] 编辑国标通道UI端口输入框使用数字输入框

---
 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