changeset 1015:0114d373748e

remove recycle()
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 24 Oct 2016 01:26:16 -0600
parents 36fcc157bf5f
children 8c13b9224cff
files src/org/eclipse/jetty/server/AbstractHttpConnection.java src/org/eclipse/jetty/server/Request.java src/org/eclipse/jetty/server/Response.java
diffstat 3 files changed, 11 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Mon Oct 24 01:08:34 2016 -0600
+++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Mon Oct 24 01:26:16 2016 -0600
@@ -96,12 +96,12 @@
 
 	protected final HttpParser _parser;
 	protected final HttpFields _requestFields = new HttpFields();
-	public final Request _request;
+	public volatile Request _request;
 	private volatile ServletInputStream _in;
 
 	protected final HttpGenerator _generator;
 	final HttpFields _responseFields = new HttpFields();
-	protected final Response _response;
+	protected volatile Response _response;
 	private volatile Output _out;
 	private volatile HttpWriter _writer;
 	private volatile PrintWriter _printWriter;
@@ -121,10 +121,14 @@
 		super(endpoint);
 		_connector = connector;
 		_parser = new HttpParser(_connector.getRequestBuffers(), endpoint, new RequestHandler());
+		_generator = new HttpGenerator(_connector.getResponseBuffers(), endpoint);
+		_server = connector.server;
+		init();
+	}
+
+	private void init() {
 		_request = new Request(this);
 		_response = new Response(this);
-		_generator = new HttpGenerator(_connector.getResponseBuffers(), endpoint);
-		_server = connector.server;
 	}
 
 	public final Connector getConnector()
@@ -225,14 +229,13 @@
 		_parser.reset();
 		_parser.returnBuffers(); // TODO maybe only on unhandle
 		_requestFields.clear();
-		_request.recycle();
 		_generator.reset();
 		_generator.returnBuffers();// TODO maybe only on unhandle
 		_responseFields.clear();
-		_response.recycle();
 		_uri.clear();
 		_writer = null;
 		_earlyEOF = false;
+		init();
 	}
 
 	private void handleRequest() throws IOException
--- a/src/org/eclipse/jetty/server/Request.java	Mon Oct 24 01:08:34 2016 -0600
+++ b/src/org/eclipse/jetty/server/Request.java	Mon Oct 24 01:26:16 2016 -0600
@@ -862,7 +862,7 @@
 	{
 		return false;
 	}
-
+/*
 	protected void recycle()
 	{
 		_handled = false;
@@ -891,7 +891,7 @@
 		_paramsExtracted = false;
 		_inputState = __NONE;
 	}
-
+*/
 	@Override
 	public void removeAttribute(String name)
 	{
--- a/src/org/eclipse/jetty/server/Response.java	Mon Oct 24 01:08:34 2016 -0600
+++ b/src/org/eclipse/jetty/server/Response.java	Mon Oct 24 01:26:16 2016 -0600
@@ -97,21 +97,6 @@
 		_connection = connection;
 	}
 
-
-	void recycle()
-	{
-		_status = SC_OK;
-		_reason = null;
-		_locale = null;
-		_mimeType = null;
-		_cachedMimeType = null;
-		_characterEncoding = null;
-		_explicitEncoding = false;
-		_contentType = null;
-		_writer = null;
-		_outputState = NONE;
-	}
-
 	public void addCookie(HttpCookie cookie)
 	{
 		_connection._responseFields.addSetCookie(cookie);