diff src/org/eclipse/jetty/http/HttpParser.java @ 1048:2b769da7f67d

remove Buffer
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Nov 2016 23:15:42 -0700
parents a8c92b0a08ed
children 5ef954fad97b
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpParser.java	Mon Nov 07 22:51:09 2016 -0700
+++ b/src/org/eclipse/jetty/http/HttpParser.java	Mon Nov 07 23:15:42 2016 -0700
@@ -20,7 +20,7 @@
 
 import java.io.IOException;
 
-import org.eclipse.jetty.io.Buffer;
+import org.eclipse.jetty.io.JBuffer;
 import org.eclipse.jetty.io.BufferUtil;
 import org.eclipse.jetty.io.EndPoint;
 import org.eclipse.jetty.io.EofException;
@@ -56,9 +56,9 @@
 
 	private final EventHandler _handler;
 	private final EndPoint _endp;
-	public final Buffer _header; // Buffer for header data (and small _content)
-	private final Buffer _body; // Buffer for large content
-	private Buffer _buffer; // The current buffer in use (either _header or _content)
+	public final JBuffer _header; // JBuffer for header data (and small _content)
+	private final JBuffer _body; // JBuffer for large content
+	private JBuffer _buffer; // The current buffer in use (either _header or _content)
 	private int _mark = -1;
 	private String _cached;
 	private String _tok0 = ""; // Saved token: header name, request method or response version
@@ -67,7 +67,7 @@
 	private int _responseStatus; // If >0 then we are parsing a response
 	private boolean _persistent;
 
-	private Buffer _contentView = BufferUtil.EMPTY_BUFFER; // View of the content in the buffer for {@link Input}
+	private JBuffer _contentView = BufferUtil.EMPTY_BUFFER; // View of the content in the buffer for {@link Input}
 	private int _state = STATE_START;
 	private byte _eol;
 	private int _length;
@@ -77,7 +77,7 @@
 	private int _chunkPosition;
 	private boolean _headResponse;
 
-	public HttpParser(Buffer headerBuffer,Buffer bodyBuffer, EndPoint endp, EventHandler handler)
+	public HttpParser(JBuffer headerBuffer,JBuffer bodyBuffer, EndPoint endp, EventHandler handler)
 	{
 		_header = headerBuffer;
 		_body = bodyBuffer;
@@ -89,8 +89,8 @@
 		_mark = _buffer.getIndex() - 1;
 	}
 
-	private Buffer sliceFromMark() {
-		Buffer buf = _buffer.sliceFrom(_mark);
+	private JBuffer sliceFromMark() {
+		JBuffer buf = _buffer.sliceFrom(_mark);
 		_mark = -1;
 		return buf;
 	}
@@ -234,7 +234,7 @@
 					{
 						if (_buffer.remaining()>0 && !_headResponse)
 						{
-							Buffer chunk = _buffer.get(_buffer.remaining());
+							JBuffer chunk = _buffer.get(_buffer.remaining());
 							_contentPosition += chunk.remaining();
 							_contentView = chunk;
 							_handler.content(); // May recurse here
@@ -781,7 +781,7 @@
 				{
 					case STATE_EOF_CONTENT:
 					{
-						Buffer chunk = _buffer.get(_buffer.remaining());
+						JBuffer chunk = _buffer.get(_buffer.remaining());
 						_contentPosition += chunk.remaining();
 						_contentView = chunk;
 						_handler.content(); // May recurse here
@@ -806,7 +806,7 @@
 							length=(int)remaining;
 						}
 
-						Buffer chunk = _buffer.get(length);
+						JBuffer chunk = _buffer.get(length);
 						_contentPosition += chunk.remaining();
 						_contentView = chunk;
 						_handler.content(); // May recurse here
@@ -897,7 +897,7 @@
 						}
 						else if (length > remaining)
 							length=remaining;
-						Buffer chunk = _buffer.get(length);
+						JBuffer chunk = _buffer.get(length);
 						_contentPosition += chunk.remaining();
 						_chunkPosition += chunk.remaining();
 						_contentView = chunk;
@@ -1005,7 +1005,7 @@
 				_contentLength);
 	}
 
-	public Buffer blockForContent(long maxIdleTime) throws IOException
+	public JBuffer blockForContent(long maxIdleTime) throws IOException
 	{
 		if (_contentView.remaining()>0)
 			return _contentView;