diff src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 1015:0114d373748e

remove recycle()
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 24 Oct 2016 01:26:16 -0600
parents 36fcc157bf5f
children d2c3ff33387c
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