xml-rpc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-rpc/src/java/org/apache/xmlrpc XmlRpc.java
Date Mon, 11 Nov 2002 23:53:41 GMT
dlr         2002/11/11 15:53:41

  Modified:    src/java/org/apache/xmlrpc XmlRpc.java
  Log:
  * parse(InputStream): Don't retain memory for huge CDATA buffers past
    the life of a request.  Reported by Glen Lewis <glewis@lspeed.com>.
  
  Revision  Changes    Path
  1.34      +15 -2     xml-rpc/src/java/org/apache/xmlrpc/XmlRpc.java
  
  Index: XmlRpc.java
  ===================================================================
  RCS file: /home/cvs/xml-rpc/src/java/org/apache/xmlrpc/XmlRpc.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -u -r1.33 -r1.34
  --- XmlRpc.java	10 Oct 2002 00:33:24 -0000	1.33
  +++ XmlRpc.java	11 Nov 2002 23:53:41 -0000	1.34
  @@ -414,7 +414,20 @@
           {
               System.out.println("Beginning parsing XML input stream");
           }
  -        parser.parse(new InputSource (is));
  +        try
  +        {
  +            parser.parse(new InputSource (is));
  +        }
  +        finally
  +        {
  +            // Clear any huge buffers.
  +            if (cdata.length() > 128 * 4)
  +            {
  +                // Exceeded original capacity by greater than 4x; release
  +                // buffer to prevent leakage.
  +                cdata = null;
  +            }
  +        }
           if (debug)
           {
               System.out.println ("Spent " + (System.currentTimeMillis() - now)
  
  
  

Mime
View raw message