From: markt Date: Tue, 23 Aug 2011 14:50:27 +0000 (+0000) Subject: Pull up refillReadBuffer() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ab80bf5bcc2604adee5053c9663dc7aefa5401bb;p=tomcat7.0 Pull up refillReadBuffer() git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1160721 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java index 8f98a8858..6adf576c6 100644 --- a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java +++ b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java @@ -544,7 +544,6 @@ public abstract class AbstractAjpProcessor extends AbstractProcessor { // Methods used by SocketInputBuffer protected abstract boolean receive() throws IOException; - protected abstract boolean refillReadBuffer() throws IOException; @Override @@ -555,6 +554,34 @@ public abstract class AbstractAjpProcessor extends AbstractProcessor { /** + * Get more request body data from the web server and store it in the + * internal buffer. + * + * @return true if there is more data, false if not. + */ + protected boolean refillReadBuffer() throws IOException { + // If the server returns an empty packet, assume that that end of + // the stream has been reached (yuck -- fix protocol??). + // FORM support + if (replay) { + endOfStream = true; // we've read everything there is + } + if (endOfStream) { + return false; + } + + // Request more data immediately + output(getBodyMessageArray, 0, getBodyMessageArray.length); + + boolean moreData = receive(); + if( !moreData ) { + endOfStream = true; + } + return moreData; + } + + + /** * After reading the request headers, we have to setup the request filters. */ protected void prepareRequest() { diff --git a/java/org/apache/coyote/ajp/AjpAprProcessor.java b/java/org/apache/coyote/ajp/AjpAprProcessor.java index 7db138a91..6ccbeab15 100644 --- a/java/org/apache/coyote/ajp/AjpAprProcessor.java +++ b/java/org/apache/coyote/ajp/AjpAprProcessor.java @@ -377,35 +377,6 @@ public class AjpAprProcessor extends AbstractAjpProcessor { return true; } - /** - * Get more request body data from the web server and store it in the - * internal buffer. - * - * @return true if there is more data, false if not. - */ - @Override - protected boolean refillReadBuffer() throws IOException { - // If the server returns an empty packet, assume that that end of - // the stream has been reached (yuck -- fix protocol??). - // FORM support - if (replay) { - endOfStream = true; // we've read everything there is - } - if (endOfStream) { - return false; - } - - // Request more data immediately - Socket.send(socket.getSocket().longValue(), getBodyMessageArray, 0, - getBodyMessageArray.length); - - boolean moreData = receive(); - if( !moreData ) { - endOfStream = true; - } - return moreData; - } - /** * Read an AJP message. diff --git a/java/org/apache/coyote/ajp/AjpNioProcessor.java b/java/org/apache/coyote/ajp/AjpNioProcessor.java index de98eb668..f6500a166 100644 --- a/java/org/apache/coyote/ajp/AjpNioProcessor.java +++ b/java/org/apache/coyote/ajp/AjpNioProcessor.java @@ -383,34 +383,6 @@ public class AjpNioProcessor extends AbstractAjpProcessor { return true; } - /** - * Get more request body data from the web server and store it in the - * internal buffer. - * - * @return true if there is more data, false if not. - */ - @Override - protected boolean refillReadBuffer() throws IOException { - // If the server returns an empty packet, assume that that end of - // the stream has been reached (yuck -- fix protocol??). - // FORM support - if (replay) { - endOfStream = true; // we've read everything there is - } - if (endOfStream) { - return false; - } - - // Request more data immediately - output(getBodyMessageArray, 0, getBodyMessageArray.length); - - boolean moreData = receive(); - if( !moreData ) { - endOfStream = true; - } - return moreData; - } - /** * Read an AJP message. diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index 3c69b8300..543f89fa6 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -341,35 +341,6 @@ public class AjpProcessor extends AbstractAjpProcessor { } /** - * Get more request body data from the web server and store it in the - * internal buffer. - * - * @return true if there is more data, false if not. - */ - @Override - protected boolean refillReadBuffer() throws IOException { - // If the server returns an empty packet, assume that that end of - // the stream has been reached (yuck -- fix protocol??). - // FORM support - if (replay) { - endOfStream = true; // we've read everything there is - } - if (endOfStream) { - return false; - } - - // Request more data immediately - output.write(getBodyMessageArray); - - boolean moreData = receive(); - if( !moreData ) { - endOfStream = true; - } - return moreData; - } - - - /** * Read an AJP message. * * @return true if the message has been read, false if the short read