2012/9/30 Florian Fray <f...@itcf.biz>: > Thanks for your reply, Konstantin and Jess. > The main reason for adding this feature to the Container is the same as for > all features provided by a Container: > My applications should not deal with these details. > > Currently I'm looking at adding Googles Snappy to some servers. > I could add filters to my applications, but if possible, I'd like to get > around this, as I'd have to do it to a bunch of applications, > partially running on the same Tomcat or JBoss instances. > > I'm currently thinking about which way to go. > Patching Tomcat was not that hard and it was fun anyway. > Maintaining a custom Tomcat codeline is something I'd like to avoid (I've > already got a customized installation, but this deals only with > configuration and packaging). > Maybe Jess is right and a ServletFilter is not that bad, grmbl :-) > > I've already implemented an initial version. It's not ideal, but it's enough > for me to play around: > > > Your feedback is highly appreciated! > > Best regards, > > Florian > > Am 30.09.2012 um 10:42 schrieb Konstantin Kolinko: > > 2012/9/29 Florian Fray <f...@itcf.biz>: > > Dear TC Devs, > > > while looking around in TC 7 I've found no possibility to plug-in a custom > compression filter. > > > So I've had a quick look at the code to find out that the gzip-handling is > coded into AbstractHttp11Processor. > > > Only HTTP protocol management is performed by AbstractHttp11Processor. > The gzip support is just an org.apache.coyote.http11.OutputFilter. > > Though I could create a custom processor, I'd like to know whether there's > any interest in having the standard processors supporting custom > compressions. > > > > There might be an interest, > but until it is really requested by someone, and someone takes the > time to implement it (aka scratch their own itch), very little can be > done. Do you care to explain what "custom" compressions do you need? > Can you propose a patch? > > If you need help to understand Tomcat code / writing a patch, just ask > on this list. > > > 2012/9/30 Jess Holle <je...@ptc.com>: > > It is quite possible to write a custom compression filter as a servlet > > filter that will work across multiple servlet engines. > > > > +1. > > There is a sample gzip filter in the examples webapp > (compressionFilters.CompressionFilter). > > There exists a gzip filter in the Ehcache project. > > It is likely that there are others as well. >
1. Please do not top-post http://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style 2. Do not use HTML formatting 3. The proper way to submit patches is through Bugzilla. Attachments on this mailing list are usually stripped by the mail server. (I received yours, but that looks like an exception). The patch looks interesting. Just noting, that there is certainly an error in it. In findCompressionFilter(): a) // If force mode, always compress (test purposes only) if (compressionLevel == 2) { - return true; + return null; } b) if (noCompressionUserAgents != null && noCompressionUserAgents.matcher(userAgentValue).matches()) { - return false; + return null; } You cannot replace both "true" and "false" results with null. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org