tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1067734 - /tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
Date Sun, 06 Feb 2011 20:45:07 GMT
2011/2/6  <markt@apache.org>:
> Author: markt
> Date: Sun Feb  6 19:28:48 2011
> New Revision: 1067734
>
> URL: http://svn.apache.org/viewvc?rev=1067734&view=rev
> Log:
> First attempt at a valve to limit session creation by web crawlers.
> Docs etc to follow once it is confirmed working.
>
> Added:
>    tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java  
(with props)
>


> +            uaMatcher = Pattern.compile(crawlerUserAgents).matcher("");

Wrong.
1) Pattern is threadsafe, but Matcher is not.
2) If set*() method in not called, uaMatcher is not initialized and
remains null by default.

BTW, are these bots using several user-agent headers?  Maybe do not
enable the valve if there are multiple headers?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message