[vlma-devel] commit: RrdGraphServlet improvement. (Adrien Grand )

git version control git at videolan.org
Fri May 16 12:55:11 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Fri May 16 08:57:44 2008 +0200| [5c9d7056575c048acc8a83a8bb7bd93297187ece]

RrdGraphServlet improvement.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=5c9d7056575c048acc8a83a8bb7bd93297187ece
---

 .../videolan/vlma/web/servlet/RrdGraphServlet.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlma-webapp/src/main/java/org/videolan/vlma/web/servlet/RrdGraphServlet.java b/vlma-webapp/src/main/java/org/videolan/vlma/web/servlet/RrdGraphServlet.java
index 82ed3de..bc90de5 100644
--- a/vlma-webapp/src/main/java/org/videolan/vlma/web/servlet/RrdGraphServlet.java
+++ b/vlma-webapp/src/main/java/org/videolan/vlma/web/servlet/RrdGraphServlet.java
@@ -44,7 +44,7 @@ import org.videolan.vlma.model.exception.InvalidServerNameException;
  */
 public class RrdGraphServlet extends HttpServlet {
 
-    private final static int bufsize = 32768;
+    private final static int bufsize = 1024;
 
     @Override
     protected void doGet(HttpServletRequest request,
@@ -73,9 +73,11 @@ public class RrdGraphServlet extends HttpServlet {
         response.setContentType("image/png");
         ServletOutputStream out = response.getOutputStream();
         byte[] image = new byte[bufsize];
-        in.read(image);
+        while (in.read(image) != -1) {
+            out.write(image);
+        }
         in.close();
-        out.write(image);
+        out.close();
     }
 
 }



More information about the vlma-devel mailing list