From c70ab14fbd4e4f49579daca8d960980e3e0777ae Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Wed, 4 Jan 2017 23:21:37 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20"=D1=83=D0=B1=D1=80=D0=B0=D0=BB"=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=BF=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D1=81=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kinosearch/webapp/WebAppController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/kinosearch/webapp/WebAppController.java b/src/main/java/kinosearch/webapp/WebAppController.java index 9c12711..32a910f 100644 --- a/src/main/java/kinosearch/webapp/WebAppController.java +++ b/src/main/java/kinosearch/webapp/WebAppController.java @@ -194,12 +194,16 @@ public class WebAppController { BufferedOutputStream proxyToClientBuf = new BufferedOutputStream(response.getOutputStream()); int oneByte; - while ((oneByte = webToProxyBuf.read()) != -1) { - proxyToClientBuf.write(oneByte); + try { + while ((oneByte = webToProxyBuf.read()) != -1) { + proxyToClientBuf.write(oneByte); + } + proxyToClientBuf.flush(); + proxyToClientBuf.close(); + } catch (Exception ignore) { + // ignore } - proxyToClientBuf.flush(); - proxyToClientBuf.close(); webToProxyBuf.close(); con.disconnect(); }