-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 20/01/2014 21:38, Jeremy Boynes wrote: > I started to look at using HttpParser for the Cookie header but > there are some differences in the way it works compared to the > existing parser in Cookies that I wanted to check direction before > getting too far in. > > The area I’m concerned about is the need to copy the bytes in > order to parse the header. The Cookies parser relies heavily on > MessageBytes and avoids copying to a String as far as possible. > HttpParser, however, operates on a StringReader which requires > converting to a String before parsing. > > After digging into the usage of Cookies I think there are only two > places that read them: 1) Request#getCookies(), which needs to > copy to Strings anyway in order to create the Cookie instances it > returns 2) CoyoteAdapter#parseSessionCookiesId(), which parses the > header and compares names as MessageBytes, only allocating a String > for the value if the session cookie is found > > It’s this second one that has me concerned about switching to > HttpParser as this gets called for every request. If we switch > then there is going to be allocation and copying of the header that > we currently don’t do.
I share your concern. Worst case, we'll need to do a specific MessageBytes based parse just for the session cookie. Assuming that the session cookie name and value will remain US-ASCII (see no reason why this should not be the case), we could get away with this as long as we are mindful that there might be some UTF-8 we need to skip over. No objections here to you continuing as per you plan. Mark -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS3Zu7AAoJEBDAHFovYFnnYS8P/ihRKZ1VgAbwGG4f1fu8w232 IecFGCXRRuW48SZuj3ADX/rUwab+yoj/1N4QQetS7LRVhnQWDmNdZuQ596d8vsA0 HXHkAmtw4Et/s9r8QH+2UGabt65BjAsIlMU6OXJWn2Ph/N3b18sh0vHyW248WUs5 ck21WC8dAj4faqaJR9VI0N99Asq9Q6SoMswP7KYn7LhoLRA4oo3MtzGv7jW4m0BL aDAlS13JqzO4dImo4MBsm5fevvuVhXppRBglkHuqVTYDrZ6hI4HGZ4VtoNcs352x tNsDZU82LAxzL4Ix3Lsdxa7xOHxa6Dlffwh6YitwEERUhRYG0i//xLHER7lac83d D+x5A2JFCvGxIN/jvLR5Up56+IzxhnVfPsiFpoa9ABtjxVvoiHzqGZu3ltBFdwbt TEwG7uUD3L0pZ3yN1vGkDnEy7e15Aju5tMhd9PzCctSW1+ytPJv6psnxYucL+u6u VlN8+wEmXFl3OIM9NhPtmW1qgu42zlWZl48RSfkoBMGmIUeE8FVS6uDsCZEHLmF3 +R/EiKPkDk+AkooCY5l3pEvM5WCPZpRj/8qCITEZJ0ETurmQ885Mn1sevK1oZQuX tkKIG+3ICbDewwaFqGDwvy3lKOYOMK+D6xlt5If6iPqGgHjXIVC8LrtXfoX+wh44 g/+QPXHlVkX5eOlvi5Qb =xnh9 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org