Author: markt Date: Mon Jun 1 20:15:46 2015 New Revision: 1682991 URL: http://svn.apache.org/r1682991 Log: Make fill() consistent with other read methods
Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_3_2.java Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java?rev=1682991&r1=1682990&r2=1682991&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java Mon Jun 1 20:15:46 2015 @@ -51,7 +51,7 @@ class Http2Parser { * @throws IOException If an IO error occurs while trying to read a frame */ public void readFrame(boolean block) throws IOException { - input.fill(frameHeaderBuffer, block); + input.fill(block, frameHeaderBuffer); // TODO: This is incomplete } @@ -69,7 +69,7 @@ class Http2Parser { byte[] data = new byte[CLIENT_PREFACE_START.length]; try { - input.fill(data, true); + input.fill(true, data); } catch (IOException ioe) { if (log.isDebugEnabled()) { log.debug(sm.getString("http2Parser.preface.io"), ioe); @@ -102,9 +102,9 @@ class Http2Parser { * no data is available. If any data is available then the buffer will * be filled with blocking I/O. * - * @param data Buffer to fill * @param block Should the first read into the provided buffer be a * blocking read or not. + * @param data Buffer to fill * * @return <code>true</code> if the buffer was filled otherwise * <code>false</code> @@ -112,6 +112,6 @@ class Http2Parser { * @throws IOException If an I/O occurred while obtaining data with * which to fill the buffer */ - boolean fill(byte[] data, boolean block) throws IOException; + boolean fill(boolean block, byte[] data) throws IOException; } } Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1682991&r1=1682990&r2=1682991&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Mon Jun 1 20:15:46 2015 @@ -1077,7 +1077,7 @@ public class Http2UpgradeHandler extends // ----------------------------------------------- Http2Parser.Input methods @Override - public boolean fill(byte[] data, boolean block) throws IOException { + public boolean fill(boolean block, byte[] data) throws IOException { int len = data.length; int pos = 0; boolean nextReadBlock = block; Modified: tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java?rev=1682991&r1=1682990&r2=1682991&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java (original) +++ tomcat/trunk/test/org/apache/coyote/http2/Http2TestBase.java Mon Jun 1 20:15:46 2015 @@ -140,7 +140,7 @@ public abstract class Http2TestBase exte // Looking for \r\n\r\n int seen = 0; while (seen < 4) { - input.fill(singleByte, true); + input.fill(true, singleByte); switch (seen) { case 0: case 2: { @@ -186,7 +186,7 @@ public abstract class Http2TestBase exte @Override - public boolean fill(byte[] data, boolean block) throws IOException { + public boolean fill(boolean block, byte[] data) throws IOException { // Note: Block is ignored for this test class. Reads always block. int off = 0; int len = data.length; Modified: tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_3_2.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_3_2.java?rev=1682991&r1=1682990&r2=1682991&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_3_2.java (original) +++ tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_3_2.java Mon Jun 1 20:15:46 2015 @@ -134,7 +134,7 @@ public class TestHttp2Section_3_2 extend } int len = Integer.parseInt(cl.substring(pos + 1).trim()); byte[] content = new byte[len]; - input.fill(content, true); + input.fill(true, content); return; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org