Author: markt Date: Fri Mar 11 11:13:58 2016 New Revision: 1734531 URL: http://svn.apache.org/viewvc?rev=1734531&view=rev Log: Fix potential indefinite wait. Reported by Coverity Scan
Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml tomcat/tc8.0.x/trunk/webapps/examples/WEB-INF/classes/chat/ChatServlet.java Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1734531&r1=1734530&r2=1734531&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Fri Mar 11 11:13:58 2016 @@ -255,6 +255,10 @@ <code>ServletRequest.getServerPort()</code> in Proxy How-To. Issue reported via comments.apache.org. (violetagg) </fix> + <fix> + Fix a potenital indefinite wait in the Comet Chat servlet in the + examples web application. (markt) + </fix> </changelog> </subsection> <subsection name="Tribes"> Modified: tomcat/tc8.0.x/trunk/webapps/examples/WEB-INF/classes/chat/ChatServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/examples/WEB-INF/classes/chat/ChatServlet.java?rev=1734531&r1=1734530&r2=1734531&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/webapps/examples/WEB-INF/classes/chat/ChatServlet.java (original) +++ tomcat/tc8.0.x/trunk/webapps/examples/WEB-INF/classes/chat/ChatServlet.java Fri Mar 11 11:13:58 2016 @@ -225,7 +225,7 @@ public class ChatServlet String[] pendingMessages; synchronized (messages) { try { - if (messages.size() == 0) { + if (running && messages.size() == 0) { messages.wait(); } } catch (InterruptedException e) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org