diff src/org/eclipse/jetty/http/HttpGenerator.java @ 1019:f126d30e04a4

start replacing BufferCache with StringCache
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 31 Oct 2016 03:33:42 -0600
parents 83cc6e05a58f
children 6be43ef1eb96
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpGenerator.java	Mon Oct 24 05:37:24 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpGenerator.java	Mon Oct 31 03:33:42 2016 -0600
@@ -53,7 +53,7 @@
 	private static final Status[] __status = new Status[HttpStatus.MAX_CODE+1];
 	static
 	{
-		int versionLength=HttpVersions.HTTP_1_1_BUFFER.length();
+		final int versionLength=HttpVersions.HTTP_1_1_BYTES.length;
 
 		for (int i=0;i<__status.length;i++)
 		{
@@ -62,7 +62,8 @@
 				continue;
 			String reason=code.getMessage();
 			byte[] bytes=new byte[versionLength+5+reason.length()+2];
-			HttpVersions.HTTP_1_1_BUFFER.peek(0,bytes, 0, versionLength);
+//			HttpVersions.HTTP_1_1_BUFFER.peek(0,bytes, 0, versionLength);
+			System.arraycopy(HttpVersions.HTTP_1_1_BYTES,0,bytes,0,versionLength);
 			bytes[versionLength+0]=' ';
 			bytes[versionLength+1]=(byte)('0'+i/100);
 			bytes[versionLength+2]=(byte)('0'+(i%100)/10);
@@ -349,7 +350,7 @@
 					_header.put((byte)' ');
 					_header.put(_uri.getBytes("UTF-8")); // TODO check
 					_header.put((byte)' ');
-					_header.put(_version==HttpVersions.HTTP_1_0_ORDINAL?HttpVersions.HTTP_1_0_BUFFER:HttpVersions.HTTP_1_1_BUFFER);
+					_header.put(_version==HttpVersions.HTTP_1_0_ORDINAL?HttpVersions.HTTP_1_0_BYTES:HttpVersions.HTTP_1_1_BYTES);
 					_header.put(HttpTokens.CRLF);
 				}
 			}
@@ -373,7 +374,7 @@
 
 					if (status==null)
 					{
-						_header.put(HttpVersions.HTTP_1_1_BUFFER);
+						_header.put(HttpVersions.HTTP_1_1_BYTES);
 						_header.put((byte) ' ');
 						_header.put((byte) ('0' + _status / 100));
 						_header.put((byte) ('0' + (_status % 100) / 10));