Author: kkolinko
Date: Thu Jun 14 15:24:34 2012
New Revision: 1350294
URL: http://svn.apache.org/viewvc?rev=1350294&view=rev
Log:
Improve InternalNioInputBuffer#parseHeaders()
Move the code and s/end/pos/
Modified:
tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1350294&r1=1350293&r2=1350294&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Thu
Jun 14 15:24:34 2012
@@ -473,10 +473,6 @@ public class InternalNioInputBuffer exte
do {
status = parseHeader();
- } while ( status == HeaderParseStatus.HAVE_MORE_HEADERS );
- if (status == HeaderParseStatus.DONE) {
- parsingHeader = false;
- end = pos;
// Checking that
// (1) Headers plus request line size does not exceed its limit
// (2) There are enough bytes to avoid expanding the buffer when
@@ -485,11 +481,15 @@ public class InternalNioInputBuffer exte
// limitation to enforce the meaning of headerBufferSize
// From the way how buf is allocated and how blank lines are being
// read, it should be enough to check (1) only.
- if (end - skipBlankLinesBytes > headerBufferSize
- || buf.length - end < socketReadBufferSize) {
+ if (pos - skipBlankLinesBytes > headerBufferSize
+ || buf.length - pos < socketReadBufferSize) {
throw new IllegalArgumentException(
sm.getString("iib.requestheadertoolarge.error"));
}
+ } while ( status == HeaderParseStatus.HAVE_MORE_HEADERS );
+ if (status == HeaderParseStatus.DONE) {
+ parsingHeader = false;
+ end = pos;
return true;
} else {
return false;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]