Author: markt Date: Wed Feb 4 19:06:26 2015 New Revision: 1657374 URL: http://svn.apache.org/r1657374 Log: Fix broken non-blocking unit test on Linux.
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java?rev=1657374&r1=1657373&r2=1657374&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11OutputBuffer.java Wed Feb 4 19:06:26 2015 @@ -583,6 +583,11 @@ public class Http11OutputBuffer implemen } + public void registerWriteInterest() { + socketWrapper.registerWriteInterest(); + } + + // ------------------------------------------ SocketOutputBuffer Inner Class /** Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1657374&r1=1657373&r2=1657374&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed Feb 4 19:06:26 2015 @@ -1737,9 +1737,14 @@ public class Http11Processor extends Abs if (outputBuffer.hasDataToWrite()) { if (outputBuffer.flushBuffer(false)) { - // There is data to write but go via Response to - // maintain a consistent view of non-blocking state - response.checkRegisterForWrite(); + // The buffer wasn't fully flushed so re-register the + // socket for write. Note this does not go via the + // Response since the write registration state at + // that level should remain unchanged. Once the buffer + // has been emptied then the code below will call + // Adaptor.asyncDispatch() which will enable the + // Response to respond to this event. + outputBuffer.registerWriteInterest(); return SocketState.LONG; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org