Author: markt Date: Fri Aug 30 21:26:11 2013 New Revision: 1519091 URL: http://svn.apache.org/r1519091 Log: Align the readMessage() signature in NIO with the BIO and APR.
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1519091&r1=1519090&r2=1519091&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Fri Aug 30 21:26:11 2013 @@ -100,8 +100,7 @@ public class AjpNioProcessor extends Abs // Parsing the request header try { // Get first message of the request - int bytesRead = readMessage(requestHeaderMessage, false); - if (bytesRead == 0) { + if (!readMessage(requestHeaderMessage, false)) { break; } // Set back timeout if keep alive timeout is enabled @@ -396,10 +395,11 @@ public class AjpNioProcessor extends Abs /** * Read an AJP message. * - * @return The number of bytes read + * @return <code>true</code> if a message was read, otherwise false + * * @throws IOException any other failure, including incomplete reads */ - protected int readMessage(AjpMessage message, boolean blockFirstRead) + protected boolean readMessage(AjpMessage message, boolean blockFirstRead) throws IOException { byte[] buf = message.getBuffer(); @@ -408,7 +408,7 @@ public class AjpNioProcessor extends Abs int bytesRead = read(buf, 0, headerLength, blockFirstRead); if (bytesRead == 0) { - return 0; + return false; } int messageLength = message.processHeader(true); @@ -419,7 +419,7 @@ public class AjpNioProcessor extends Abs } else if (messageLength == 0) { // Zero length message. - return bytesRead; + return true; } else { if (messageLength > buf.length) { @@ -431,7 +431,7 @@ public class AjpNioProcessor extends Abs Integer.valueOf(buf.length))); } bytesRead += read(buf, headerLength, messageLength, true); - return bytesRead; + return true; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org