From b67841b3196f021364b9b14cfecfd3d74bf53564 Mon Sep 17 00:00:00 2001
From: jiang <893224616@qq.com>
Date: 星期四, 18 八月 2022 15:32:12 +0800
Subject: [PATCH] 实时直播 - 开始直播接口返回值增加WEBRTC字段

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java
index 57e8045..0d02173 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java
@@ -39,7 +39,7 @@
 @Component
 public class RecordInfoResponseMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler {
 
-    private Logger logger = LoggerFactory.getLogger(RecordInfoResponseMessageHandler.class);
+    private final Logger logger = LoggerFactory.getLogger(RecordInfoResponseMessageHandler.class);
     private final String cmdType = "RecordInfo";
 
     private ConcurrentLinkedQueue<HandlerCatchData> taskQueue = new ConcurrentLinkedQueue<>();
@@ -76,10 +76,14 @@
             if (!taskQueueHandlerRun) {
                 taskQueueHandlerRun = true;
                 taskExecutor.execute(()->{
-                    try {
-                        while (!taskQueue.isEmpty()) {
+                    while (!taskQueue.isEmpty()) {
+                        try {
                             HandlerCatchData take = taskQueue.poll();
                             Element rootElementForCharset = getRootElement(take.getEvt(), take.getDevice().getCharset());
+                            if (rootElement == null) {
+                                logger.warn("[ 鍥芥爣褰曞儚 ] content cannot be null, {}", evt.getRequest());
+                                continue;
+                            }
                             String sn = getText(rootElementForCharset, "SN");
                             String channelId = getText(rootElementForCharset, "DeviceID");
                             RecordInfo recordInfo = new RecordInfo();
@@ -141,10 +145,11 @@
                                     releaseRequest(take.getDevice().getDeviceId(), sn);
                                 }
                             }
+                        } catch (DocumentException e) {
+                            throw new RuntimeException(e);
+                        } finally {
+                            taskQueueHandlerRun = false;
                         }
-                        taskQueueHandlerRun = false;
-                    }catch (DocumentException e) {
-                        throw new RuntimeException(e);
                     }
                 });
             }
@@ -155,6 +160,8 @@
             e.printStackTrace();
         } catch (ParseException e) {
             e.printStackTrace();
+        }finally {
+            taskQueueHandlerRun = false;
         }
     }
 

--
Gitblit v1.8.0