Author: markt Date: Mon Mar 18 20:35:24 2013 New Revision: 1457978 URL: http://svn.apache.org/r1457978 Log: Don't try to write zero bytes if the buffer is emoty when flushed.
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1457978&r1=1457977&r2=1457978&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Mon Mar 18 20:35:24 2013 @@ -639,10 +639,13 @@ public abstract class WsRemoteEndpointIm } if (flushRequired) { - outputBuffer.flip(); - endpoint.doWrite(this, outputBuffer); flushRequired = false; - return; + outputBuffer.flip(); + if (outputBuffer.remaining() == 0) { + handler.onResult(new SendResult()); + } else { + endpoint.doWrite(this, outputBuffer); + } } else { handler.onResult(new SendResult()); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org