Author: markt
Date: Mon Sep 2 13:24:10 2013
New Revision: 1519435
URL: http://svn.apache.org/r1519435
Log:
Move the copying from the inputBuffer to the message buffer into the read()
method to align read() in APR/native with BIO and NIO.
Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1519435&r1=1519434&r2=1519435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Mon Sep 2
13:24:10 2013
@@ -194,7 +194,8 @@ public class AjpAprProcessor extends Abs
* @return
* @throws IOException
*/
- protected boolean read(int n, boolean block) throws IOException {
+ protected boolean read(byte[] buf, int pos, int n, boolean block)
+ throws IOException {
boolean nextReadBlocks = block;
@@ -224,6 +225,7 @@ public class AjpAprProcessor extends Abs
}
}
+ inputBuffer.get(buf, pos, n);
return true;
}
@@ -280,11 +282,10 @@ public class AjpAprProcessor extends Abs
byte[] buf = message.getBuffer();
int headerLength = message.getHeaderLength();
- if (!read(headerLength, block)) {
+ if (!read(buf, 0, headerLength, block)) {
return false;
}
- inputBuffer.get(buf, 0, headerLength);
int messageLength = message.processHeader(true);
if (messageLength < 0) {
// Invalid AJP header signature
@@ -304,8 +305,7 @@ public class AjpAprProcessor extends Abs
Integer.valueOf(messageLength),
Integer.valueOf(buf.length)));
}
- read(messageLength, true);
- inputBuffer.get(buf, headerLength, messageLength);
+ read(buf, headerLength, messageLength, true);
return true;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]