svn commit: r1804813 - in /tomcat/trunk: java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java webapps/docs/changelog.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit: r1804813 - in /tomcat/trunk: java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java webapps/docs/changelog.xml

remm
Author: remm
Date: Fri Aug 11 16:01:41 2017
New Revision: 1804813

URL: http://svn.apache.org/viewvc?rev=1804813&view=rev
Log:
Fix possible race condition when using an upgraded connection and setting the IO listeners, it now uses the same processing as non upgraded connections.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java
    tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java?rev=1804813&r1=1804812&r2=1804813&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java Fri Aug 11 16:01:41 2017
@@ -101,6 +101,8 @@ public class UpgradeServletInputStream e
             throw new IllegalStateException(sm.getString("upgrade.sis.read.closed"));
         }
 
+        this.listener = listener;
+
         // Container is responsible for first call to onDataAvailable().
         if (ContainerThreadMarker.isContainerThread()) {
             processor.addDispatch(DispatchType.NON_BLOCKING_READ);
@@ -108,7 +110,6 @@ public class UpgradeServletInputStream e
             socketWrapper.registerReadInterest();
         }
 
-        this.listener = listener;
         // Switching to non-blocking. Don't know if data is available.
         ready = null;
     }

Modified: tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java?rev=1804813&r1=1804812&r2=1804813&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java Fri Aug 11 16:01:41 2017
@@ -112,6 +112,7 @@ public class UpgradeServletOutputStream
         if (closed) {
             throw new IllegalStateException(sm.getString("upgrade.sos.write.closed"));
         }
+        this.listener = listener;
         // Container is responsible for first call to onWritePossible().
         synchronized (registeredLock) {
             registered = true;
@@ -123,7 +124,6 @@ public class UpgradeServletOutputStream
             }
         }
 
-        this.listener = listener;
     }
 
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1804813&r1=1804812&r2=1804813&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Aug 11 16:01:41 2017
@@ -72,6 +72,10 @@
         Prevent exceptions being thrown during normal shutdown of NIO
         connections. This enables TLS connections to close cleanly. (markt)
       </fix>
+      <fix>
+        Fix possible race condition when setting IO listeners on an upgraded
+        connection. (remm)
+      </fix>
     </changelog>
   </subsection>
 </section>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...