changeset 1032:eca26899c4bc

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 03:19:50 -0600
parents 921c25a05eaa
children 4ada7a8c128a
files src/org/eclipse/jetty/http/HttpFields.java src/org/eclipse/jetty/http/HttpParser.java src/org/eclipse/jetty/io/AbstractBuffer.java src/org/eclipse/jetty/io/Buffer.java src/org/eclipse/jetty/io/View.java src/org/eclipse/jetty/server/Request.java
diffstat 6 files changed, 18 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpFields.java	Thu Nov 03 02:04:40 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpFields.java	Thu Nov 03 03:19:50 2016 -0600
@@ -41,7 +41,6 @@
 
 import org.eclipse.jetty.io.Buffer;
 import org.eclipse.jetty.io.BufferUtil;
-import org.eclipse.jetty.io.ByteArrayBuffer;
 import org.eclipse.jetty.util.LazyList;
 import org.eclipse.jetty.util.QuotedStringTokenizer;
 import org.eclipse.jetty.util.StringUtil;
--- a/src/org/eclipse/jetty/http/HttpParser.java	Thu Nov 03 02:04:40 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpParser.java	Thu Nov 03 03:19:50 2016 -0600
@@ -291,7 +291,7 @@
 						{
 //System.out.println("qqqqqqqqqqqqqqqq a "+_tok0);
 //							_tok0.update(_buffer.markIndex(), _buffer.getIndex() - 1);
-							_tok0 = _buffer.peek(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex()).toString();
+							_tok0 = _buffer.toString(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex());
 //System.out.println("qqqqqqqqqqqqqqqq b "+_tok0);
 							_responseStatus = !HttpVersions.CACHE.contains(_tok0)?-1:0;
 							_state=STATE_SPACE1;
@@ -325,7 +325,7 @@
 						if (ch == HttpTokens.SPACE)
 						{
 //							_tok1.update(_buffer.markIndex(), _buffer.getIndex() - 1);
-							_tok1 = _buffer.peek(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex()).toString();
+							_tok1 = _buffer.toString(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex());
 							_state=STATE_SPACE2;
 							continue;
 						}
@@ -354,7 +354,7 @@
 						if (ch == HttpTokens.SPACE)
 						{
 //							_tok1.update(_buffer.markIndex(), _buffer.getIndex() - 1);
-							_tok1 = _buffer.peek(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex()).toString();
+							_tok1 = _buffer.toString(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex());
 							_state=STATE_SPACE2;
 							continue;
 						}
@@ -611,7 +611,7 @@
 								if (_length > 0) {
 //System.out.println("qqqqqqqqqqqqqqqq c "+_tok0);
 //									_tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-									_tok0 = _buffer.peek(_buffer.markIndex(), _length).toString();
+									_tok0 = _buffer.toString(_buffer.markIndex(), _length);
 //System.out.println("qqqqqqqqqqqqqqqq d "+_tok0);
 								}
 								_eol=ch;
@@ -621,7 +621,7 @@
 								if (_length > 0 && _cached==null) {
 //System.out.println("qqqqqqqqqqqqqqqq e "+_tok0);
 //									_tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-									_tok0 = _buffer.peek(_buffer.markIndex(), _length).toString();
+									_tok0 = _buffer.toString(_buffer.markIndex(), _length);
 //System.out.println("qqqqqqqqqqqqqqqq f "+_tok0);
 								}
 								_length=-1;
@@ -650,7 +650,7 @@
 								if (_length > 0) {
 //System.out.println("qqqqqqqqqqqqqqqq g "+_tok0);
 //									_tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-									_tok0 = _buffer.peek(_buffer.markIndex(),_length).toString();
+									_tok0 = _buffer.toString(_buffer.markIndex(),_length);
 //System.out.println("qqqqqqqqqqqqqqqq h "+_tok0);
 								}
 								_eol=ch;
@@ -660,7 +660,7 @@
 								if (_length > 0 && _cached==null) {
 //System.out.println("qqqqqqqqqqqqqqqq i "+_tok0);
 //									_tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-									_tok0 = _buffer.peek(_buffer.markIndex(),_length).toString();
+									_tok0 = _buffer.toString(_buffer.markIndex(),_length);
 //System.out.println("qqqqqqqqqqqqqqqq j "+_tok0);
 								}
 								_length=-1;
@@ -687,13 +687,13 @@
 								{
 									if (_tok1.length() == 0)
 //										_tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-										_tok1 = _buffer.peek(_buffer.markIndex(), _length).toString();
+										_tok1 = _buffer.toString(_buffer.markIndex(), _length);
 									else
 									{
 										// Continuation line!
 										if (_multiLineValue == null) _multiLineValue = _tok1;
 //										_tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-										_tok1 = _buffer.peek(_buffer.markIndex(), _length).toString();
+										_tok1 = _buffer.toString(_buffer.markIndex(), _length);
 										_multiLineValue += " " + _tok1;
 									}
 								}
@@ -722,13 +722,13 @@
 								{
 									if (_tok1.length() == 0)
 //										_tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-										_tok1 = _buffer.peek(_buffer.markIndex(), _length).toString();
+										_tok1 = _buffer.toString(_buffer.markIndex(), _length);
 									else
 									{
 										// Continuation line!
 										if (_multiLineValue == null) _multiLineValue = _tok1;
 //										_tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
-										_tok1 = _buffer.peek(_buffer.markIndex(), _length).toString();
+										_tok1 = _buffer.toString(_buffer.markIndex(), _length);
 										_multiLineValue += " " + _tok1;
 									}
 								}
--- a/src/org/eclipse/jetty/io/AbstractBuffer.java	Thu Nov 03 02:04:40 2016 -0600
+++ b/src/org/eclipse/jetty/io/AbstractBuffer.java	Thu Nov 03 03:19:50 2016 -0600
@@ -247,7 +247,7 @@
 		return peek(_get);
 	}
 
-	public Buffer peek(int index, int length)
+	private Buffer peek(int index, int length)
 	{
 		if (_view == null)
 		{
@@ -483,6 +483,11 @@
 	}
 
 	@Override
+	public final String toString(int index, int length) {
+		return peek(index,length).toString();
+	}
+
+	@Override
 	public final String toString(String charset)
 	{
 		try
--- a/src/org/eclipse/jetty/io/Buffer.java	Thu Nov 03 02:04:40 2016 -0600
+++ b/src/org/eclipse/jetty/io/Buffer.java	Thu Nov 03 03:19:50 2016 -0600
@@ -175,13 +175,7 @@
 	 */
 	byte peek(int index);
 
-	/**
-	 * 
-	 * @param index an <code>int</code> value
-	 * @param length an <code>int</code> value
-	 * @return The <code>Buffer</code> value from the requested getIndex.
-	 */
-	Buffer peek(int index, int length);
+	String toString(int index, int length);
 
 	/**
 	 * 
--- a/src/org/eclipse/jetty/io/View.java	Thu Nov 03 02:04:40 2016 -0600
+++ b/src/org/eclipse/jetty/io/View.java	Thu Nov 03 03:19:50 2016 -0600
@@ -128,12 +128,6 @@
 	}
 
 	@Override
-	public Buffer peek(int index, int length)
-	{
-		return _buffer.peek(index, length);
-	}
-
-	@Override
 	public int poke(int index, Buffer src)
 	{
 		return _buffer.poke(index,src); 
--- a/src/org/eclipse/jetty/server/Request.java	Thu Nov 03 02:04:40 2016 -0600
+++ b/src/org/eclipse/jetty/server/Request.java	Thu Nov 03 03:19:50 2016 -0600
@@ -70,13 +70,7 @@
 import org.eclipse.jetty.http.HttpURI;
 import org.eclipse.jetty.http.HttpVersions;
 import org.eclipse.jetty.http.MimeTypes;
-import org.eclipse.jetty.io.Buffer;
-import org.eclipse.jetty.io.BufferUtil;
-import org.eclipse.jetty.io.ByteArrayBuffer;
 import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.nio.DirectNIOBuffer;
-import org.eclipse.jetty.io.nio.IndirectNIOBuffer;
-import org.eclipse.jetty.io.nio.NIOBuffer;
 import org.eclipse.jetty.server.handler.ContextHandler;
 import org.eclipse.jetty.util.Attributes;
 import org.eclipse.jetty.util.AttributesMap;