From 90d9cd8ac8d7575d1cbd6e81ff6ed746ee82289f Mon Sep 17 00:00:00 2001
From: xu-bin-bin <34916924+xu-bin-bin@users.noreply.github.com>
Date: 星期二, 17 十月 2023 09:23:45 +0800
Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
old mode 100644
new mode 100755
index b182b26..1986b65
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
@@ -36,6 +36,7 @@
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.context.request.async.DeferredResult;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import javax.sip.InvalidArgumentException;
 import javax.sip.SipException;
@@ -472,7 +473,10 @@
 		try {
 			final InputStream in = Files.newInputStream(new File("snap" + File.separator + deviceId + "_" + channelId + (mark == null? ".jpg": ("_" + mark + ".jpg"))).toPath());
 			resp.setContentType(MediaType.IMAGE_PNG_VALUE);
+			ServletOutputStream outputStream = resp.getOutputStream();
 			IOUtils.copy(in, resp.getOutputStream());
+			in.close();
+			outputStream.close();
 		} catch (IOException e) {
 			resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
 		}

--
Gitblit v1.8.0