Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 10401 invoked from network); 22 Jul 2010 14:37:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jul 2010 14:37:14 -0000 Received: (qmail 673 invoked by uid 500); 22 Jul 2010 14:37:13 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 489 invoked by uid 500); 22 Jul 2010 14:37:12 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 480 invoked by uid 99); 22 Jul 2010 14:37:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jul 2010 14:37:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jul 2010 14:37:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 26C912388993; Thu, 22 Jul 2010 14:36:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r966692 - in /tomcat/trunk: java/org/apache/catalina/connector/Request.java webapps/docs/changelog.xml Date: Thu, 22 Jul 2010 14:36:16 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100722143616.26C912388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Thu Jul 22 14:36:15 2010 New Revision: 966692 URL: http://svn.apache.org/viewvc?rev=966692&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49613 Improve performance for multiple calls to Request.getAttributeNames() when using SSL. Patch provided by Sampo Savolainen. Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=966692&r1=966691&r2=966692&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Jul 22 14:36:15 2010 @@ -194,6 +194,13 @@ public class Request /** + * Flag that indicates if SSL attributes have been parsed to improve + * performance for applications (usually frameworks) that make multiple + * calls to {@link Request#getAttributeNames()}. + */ + protected boolean sslAttributesParsed = false; + + /** * List of read only attributes for this Request. */ private HashMap readOnlyAttributes = @@ -478,6 +485,7 @@ public class Request localName = null; attributes.clear(); + sslAttributesParsed = false; notes.clear(); cookies = null; @@ -937,6 +945,7 @@ public class Request attributes.put(Globals.SSL_SESSION_MGR_ATTR, attr); } attr = attributes.get(name); + sslAttributesParsed = true; } return attr; } @@ -981,7 +990,7 @@ public class Request * attributes and may also support additional attributes. */ public Enumeration getAttributeNames() { - if (isSecure()) { + if (isSecure() && !sslAttributesParsed) { getAttribute(Globals.CERTIFICATES_ATTR); } return new Enumerator(attributes.keySet(), true); Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=966692&r1=966691&r2=966692&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Jul 22 14:36:15 2010 @@ -184,6 +184,11 @@ by checking the DirContext or the cache. Test case based on a patch provided by Marc Guillemot. (markt) + + 49613: Improve performance when using SSL for applications + that make multiple class to Request.getAttributeNames(). + Patch provided by Sampo Savolainen. (markt) + --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org