SWF-917 ResourceServlet crash and add "Error 500" at the end of the streamed resource

Applied fix proposed in JIRA
This commit is contained in:
Scott Andrews
2008-10-20 14:23:08 +00:00
parent 2ae278e07f
commit 4a03959895

View File

@@ -113,9 +113,9 @@ public class ResourceServlet extends HttpServletBean {
InputStream in = resourceConn.getInputStream();
try {
byte[] buffer = new byte[1024];
while (in.available() > 0) {
int len = in.read(buffer);
out.write(buffer, 0, len);
int bytesRead = -1;
while ((bytesRead = in.read(buffer)) != -1) {
out.write(buffer, 0, bytesRead);
}
} finally {
in.close();