changeset 1021:e350c11242be

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 31 Oct 2016 22:49:25 -0600
parents 6be43ef1eb96
children 3718afd99988
files src/org/eclipse/jetty/http/HttpFields.java src/org/eclipse/jetty/http/HttpGenerator.java src/org/eclipse/jetty/http/HttpParser.java src/org/eclipse/jetty/io/BufferUtil.java src/org/eclipse/jetty/server/AbstractHttpConnection.java
diffstat 5 files changed, 18 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpFields.java	Mon Oct 31 22:24:41 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpFields.java	Mon Oct 31 22:49:25 2016 -0600
@@ -302,7 +302,7 @@
 		for (Field f : _fields)
 		{
 			if (f!=null)
-				list.add(BufferUtil.to8859_1_String(f._name));
+				list.add(f._name.toString());
 		}
 		return list;
 	}
@@ -1227,7 +1227,7 @@
 
 		private String getName()
 		{
-			return BufferUtil.to8859_1_String(_name);
+			return _name.toString();
 		}
 
 		public int getNameOrdinal()
--- a/src/org/eclipse/jetty/http/HttpGenerator.java	Mon Oct 31 22:24:41 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpGenerator.java	Mon Oct 31 22:49:25 2016 -0600
@@ -22,7 +22,6 @@
 import java.io.InterruptedIOException;
 
 import org.eclipse.jetty.io.Buffer;
-import org.eclipse.jetty.io.BufferCache.CachedBuffer;
 import org.eclipse.jetty.io.BufferUtil;
 import org.eclipse.jetty.io.Buffers;
 import org.eclipse.jetty.io.ByteArrayBuffer;
--- a/src/org/eclipse/jetty/http/HttpParser.java	Mon Oct 31 22:24:41 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpParser.java	Mon Oct 31 22:49:25 2016 -0600
@@ -278,8 +278,8 @@
 				switch (_state)
 				{
 					case STATE_START:
-						_contentLength=HttpTokens.UNKNOWN_CONTENT;
-						_cached=null;
+						_contentLength = HttpTokens.UNKNOWN_CONTENT;
+						_cached = null;
 						if (ch > HttpTokens.SPACE || ch<0)
 						{
 							_buffer.mark();
@@ -436,11 +436,11 @@
 								// handler last header if any
 								if (_cached!=null || _tok0.length() > 0 || _tok1.length() > 0 || _multiLineValue != null)
 								{
-									Buffer header=_cached!=null?_cached:HttpHeaders.CACHE.lookup(_tok0);
-									_cached=null;
+									String header = _cached!=null?_cached.toString():_tok0;
+									_cached = null;
 									String value = _multiLineValue == null ? _tok1.toString() : _multiLineValue;
 
-									int ho=HttpHeaders.CACHE.getOrdinal(header);
+									int ho = HttpHeaders.CACHE.getOrdinal(header);
 									if (ho >= 0)
 									{
 										int vo;
@@ -575,20 +575,20 @@
 								else
 								{
 									// New header
-									_length=1;
+									_length = 1;
 									_buffer.mark();
-									_state=STATE_HEADER_NAME;
+									_state = STATE_HEADER_NAME;
 
 									// try cached name!
 									if (array!=null)
 									{
-										_cached=HttpHeaders.CACHE.getBest(array, _buffer.markIndex(), length+1);
+										_cached = HttpHeaders.CACHE.getBest(array, _buffer.markIndex(), length+1);
 
 										if (_cached!=null)
 										{
-											_length=_cached.length();
+											_length = _cached.length();
 											_buffer.setGetIndex(_buffer.markIndex()+_length);
-											length=_buffer.length();
+											length = _buffer.length();
 										}
 									}
 								}
@@ -626,7 +626,7 @@
 								break;
 							default:
 							{
-								_cached=null;
+								_cached = null;
 								if (_length == -1)
 									_buffer.mark();
 								_length=_buffer.getIndex() - _buffer.markIndex();
@@ -666,7 +666,7 @@
 								break;
 							default:
 							{
-								_cached=null;
+								_cached = null;
 								_length++;
 							}
 						}
@@ -1142,7 +1142,7 @@
 		/**
 		 * This is the method called by parser when a HTTP Header name and value is found
 		 */
-		public void parsedHeader(Buffer name, String value) throws IOException;
+		public void parsedHeader(String name, String value) throws IOException;
 
 		/**
 		 * This is the method called by parser when the HTTP request line is parsed
--- a/src/org/eclipse/jetty/io/BufferUtil.java	Mon Oct 31 22:24:41 2016 -0600
+++ b/src/org/eclipse/jetty/io/BufferUtil.java	Mon Oct 31 22:49:25 2016 -0600
@@ -18,8 +18,6 @@
 
 package org.eclipse.jetty.io;
 
-import org.eclipse.jetty.io.BufferCache.CachedBuffer;
-import org.eclipse.jetty.util.StringUtil;
 
 /* ------------------------------------------------------------------------------- */
 /** Buffer utility methods.
@@ -274,22 +272,5 @@
 		buffer.put((byte)13);
 		buffer.put((byte)10);
 	}
-/*
-	public static boolean isPrefix(Buffer prefix,Buffer buffer)
-	{
-		if (prefix.length()>buffer.length())
-			return false;
-		int bi=buffer.getIndex();
-		for (int i=prefix.getIndex(); i<prefix.putIndex();i++)
-			if (prefix.peek(i)!=buffer.peek(bi++))
-				return false;
-		return true;
-	}
-*/
-	public static String to8859_1_String(Buffer buffer)
-	{
-		if (buffer instanceof CachedBuffer)
-			return buffer.toString();
-		return buffer.toString(StringUtil.__ISO_8859_1_CHARSET);
-	}
+
 }
--- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Mon Oct 31 22:24:41 2016 -0600
+++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Mon Oct 31 22:49:25 2016 -0600
@@ -41,7 +41,6 @@
 import org.eclipse.jetty.http.MimeTypes;
 import org.eclipse.jetty.io.AbstractConnection;
 import org.eclipse.jetty.io.Buffer;
-import org.eclipse.jetty.io.BufferCache.CachedBuffer;
 import org.eclipse.jetty.io.Buffers;
 import org.eclipse.jetty.io.ByteArrayBuffer;
 import org.eclipse.jetty.io.EndPoint;
@@ -503,7 +502,7 @@
 		}
 	}
 
-	private void parsedHeader(Buffer name, String value) throws IOException
+	private void parsedHeader(String name, String value) throws IOException
 	{
 		int ho = HttpHeaders.CACHE.getOrdinal(name);
 		switch (ho)
@@ -664,7 +663,7 @@
 		}
 
 		@Override
-		public void parsedHeader(Buffer name, String value) throws IOException
+		public void parsedHeader(String name, String value) throws IOException
 		{
 			AbstractHttpConnection.this.parsedHeader(name, value);
 		}