Author: markt
Date: Tue Oct  8 08:10:38 2013
New Revision: 1530183

URL: http://svn.apache.org/r1530183
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55633 for APR.
If the socket was registered for read and write and only one occurred, the 
registration for the other event was lost. Ensure that the socket is 
re-registered with the Poller when necessary.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1530081

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1530183&r1=1530182&r2=1530183&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue 
Oct  8 08:10:38 2013
@@ -1874,8 +1874,17 @@ public class AprEndpoint extends Abstrac
                                             ((desc[n*2] & Poll.APR_POLLOUT) == 
Poll.APR_POLLOUT) &&
                                             !processSocket(desc[n*2+1], 
SocketStatus.OPEN_WRITE)) {
                                         // Close socket and clear pool
+                                        error = true;
                                         closeSocket(desc[n*2+1]);
                                     }
+                                    if (!error) {
+                                        // If socket was registered for 
multiple events but
+                                        // only some of the occurred, 
re-register for the
+                                        // remaining events.
+                                        if (wrapper.pollerFlags != 0) {
+                                            add(desc[n*2+1], 1, 
wrapper.pollerFlags);
+                                        }
+                                    }
                                 } else {
                                     // Unknown event
                                     getLog().warn(sm.getString(



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

Reply via email to