This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 554cea6b6c05d548b10ffe9d14494839c9cb38c0 Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Apr 11 16:31:18 2023 +0100 Prep for clean-up --- java/org/apache/tomcat/util/http/MimeHeaders.java | 15 +++++++++------ .../apache/tomcat/util/http/Rfc6265CookieProcessor.java | 11 ++++++----- java/org/apache/tomcat/util/http/ServerCookie.java | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java b/java/org/apache/tomcat/util/http/MimeHeaders.java index b2b56b7d2e..89007660a8 100644 --- a/java/org/apache/tomcat/util/http/MimeHeaders.java +++ b/java/org/apache/tomcat/util/http/MimeHeaders.java @@ -67,20 +67,23 @@ import org.apache.tomcat.util.res.StringManager; /** * Memory-efficient repository for Mime Headers. When the object is recycled, it * will keep the allocated headers[] and all the MimeHeaderField - no GC is generated. - * + * <p> * For input headers it is possible to use the MessageByte for Fields - so no GC * will be generated. - * + * <p> * The only garbage is generated when using the String for header names/values - * this can't be avoided when the servlet calls header methods, but is easy * to avoid inside tomcat. The goal is to use _only_ MessageByte-based Fields, * and reduce to 0 the memory overhead of tomcat. + * <p> * * TODO: - * XXX one-buffer parsing - for http ( other protocols don't need that ) - * XXX remove unused methods - * XXX External enumerations, with 0 GC. - * XXX use HeaderName ID + * <ul> + * <li>one-buffer parsing - for http (other protocols don't need that)</li> + * <li>remove unused methods</li> + * <li>External enumerations, with 0 GC.</li> + * <li>use HeaderName ID</li> + * </ul> * * * @author d...@eng.sun.com diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java index 2a35863a2b..fae81d5657 100644 --- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java +++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java @@ -108,11 +108,12 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase { // Can't use StringBuilder due to DateFormat StringBuffer header = new StringBuffer(); - // TODO: Name validation takes place in Cookie and cannot be configured - // per Context. Moving it to here would allow per Context config - // but delay validation until the header is generated. However, - // the spec requires an IllegalArgumentException on Cookie - // generation. + /* TODO: Name validation takes place in Cookie and cannot be configured + * per Context. Moving it to here would allow per Context config + * but delay validation until the header is generated. However, + * the spec requires an IllegalArgumentException on Cookie + * generation. + */ header.append(cookie.getName()); header.append('='); String value = cookie.getValue(); diff --git a/java/org/apache/tomcat/util/http/ServerCookie.java b/java/org/apache/tomcat/util/http/ServerCookie.java index 157b76ae00..43261fe13f 100644 --- a/java/org/apache/tomcat/util/http/ServerCookie.java +++ b/java/org/apache/tomcat/util/http/ServerCookie.java @@ -26,7 +26,7 @@ import org.apache.tomcat.util.buf.MessageBytes; * Allows recycling and uses MessageBytes as low-level * representation ( and thus the byte -> char conversion can be delayed * until we know the charset ). - * + * <p> * Tomcat.core uses this recyclable object to represent cookies, * and the facade will convert it to the external representation. */ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org