From 07e3fa3ac2f602ffa4a216367521e1d2282591d5 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 11 Dec 2009 22:22:51 +0000 Subject: [PATCH] JETTY-1157 Do not hold array passed in write bytes git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1147 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../src/main/java/org/eclipse/jetty/server/HttpOutput.java | 2 ++ .../src/main/java/org/eclipse/jetty/util/ajax/JSON.java | 7 ++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 47639bec50d..4fe761e8618 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -4,6 +4,7 @@ jetty-7.0.2-SNAPSHOT + 296765 JMX Connector Server and ShutdownThread + 297421 Hide server/system classes from WebAppClassLoader.getResources + JETTY-1156 SSL blocking close with JVM Bug busy key fix + + JETTY-1157 Don't hold array passed in write(byte[]) jetty-7.0.1.v20091125 25 November 2009 + 274251 DefaultServlet supports exact match mode. diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java index ea64e52fcd1..403c29d803e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java @@ -84,6 +84,7 @@ public class HttpOutput extends ServletOutputStream { _buf.wrap(b, off, len); write(_buf); + _buf.wrap(AbstractGenerator.NO_BYTES); } /* ------------------------------------------------------------ */ @@ -95,6 +96,7 @@ public class HttpOutput extends ServletOutputStream { _buf.wrap(b); write(_buf); + _buf.wrap(AbstractGenerator.NO_BYTES); } /* ------------------------------------------------------------ */ diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java index 705b0a9b187..3c02b0e8188 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java @@ -500,9 +500,9 @@ public class JSON } /* ------------------------------------------------------------ */ - protected Map newMap() + protected Map newMap() { - return new HashMap(); + return new HashMap(); } /* ------------------------------------------------------------ */ @@ -511,6 +511,7 @@ public class JSON return new Object[size]; } + /* ------------------------------------------------------------ */ protected JSON contextForArray() { return this; @@ -817,7 +818,7 @@ public class JSON { if (source.next()!='{') throw new IllegalStateException(); - Map map=newMap(); + Map map=newMap(); char next=seekTo("\"}",source);