/**
+ * 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<String,Object> readOnlyAttributes =
localName = null;
attributes.clear();
+ sslAttributesParsed = false;
notes.clear();
cookies = null;
attributes.put(Globals.SSL_SESSION_MGR_ATTR, attr);
}
attr = attributes.get(name);
+ sslAttributesParsed = true;
}
return attr;
}
* attributes and may also support additional attributes.
*/
public Enumeration<String> getAttributeNames() {
- if (isSecure()) {
+ if (isSecure() && !sslAttributesParsed) {
getAttribute(Globals.CERTIFICATES_ATTR);
}
return new Enumerator<String>(attributes.keySet(), true);
by checking the <code>DirContext</code> or the cache. Test case based on
a patch provided by Marc Guillemot. (markt)
</fix>
+ <fix>
+ <bug>49613</bug>: Improve performance when using SSL for applications
+ that make multiple class to <code>Request.getAttributeNames()</code>.
+ Patch provided by Sampo Savolainen. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">