diff src/org/eclipse/jetty/server/Request.java @ 1020:6be43ef1eb96

HttpHeaderValues uses StringCache
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 31 Oct 2016 22:24:41 -0600
parents 0114d373748e
children 3718afd99988
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/Request.java	Mon Oct 31 03:33:42 2016 -0600
+++ b/src/org/eclipse/jetty/server/Request.java	Mon Oct 31 22:24:41 2016 -0600
@@ -676,22 +676,22 @@
 			return _serverName;
 
 		// Return host from header field
-		Buffer hostPort = _connection._requestFields.get(HttpHeaders.HOST_BUFFER);
+		String hostPort = _connection._requestFields.getStringField(HttpHeaders.HOST_BUFFER);
 		if (hostPort != null)
 		{
-			loop: for (int i = hostPort.putIndex(); i-- > hostPort.getIndex();)
+			loop: for (int i = hostPort.length(); i-- > 0;)
 			{
-				char ch = (char)(0xff & hostPort.peek(i));
+				char ch = hostPort.charAt(i);
 				switch (ch)
 				{
 					case ']':
 						break loop;
 
 					case ':':
-						_serverName = BufferUtil.to8859_1_String(hostPort.peek(hostPort.getIndex(),i - hostPort.getIndex()));
+						_serverName = hostPort.substring(0,i);
 						try
 						{
-							_port = BufferUtil.toInt(hostPort.peek(i + 1,hostPort.putIndex() - i - 1));
+							_port = Integer.parseInt(hostPort.substring(i + 1));
 						}
 						catch (NumberFormatException e)
 						{
@@ -709,7 +709,7 @@
 			}
 			if (_serverName == null || _port < 0)
 			{
-				_serverName = BufferUtil.to8859_1_String(hostPort);
+				_serverName = hostPort;
 				_port = 0;
 			}