comparison 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
comparison
equal deleted inserted replaced
1014:36fcc157bf5f 1015:0114d373748e
94 private final Server _server; 94 private final Server _server;
95 protected final HttpURI _uri = new HttpURI(); 95 protected final HttpURI _uri = new HttpURI();
96 96
97 protected final HttpParser _parser; 97 protected final HttpParser _parser;
98 protected final HttpFields _requestFields = new HttpFields(); 98 protected final HttpFields _requestFields = new HttpFields();
99 public final Request _request; 99 public volatile Request _request;
100 private volatile ServletInputStream _in; 100 private volatile ServletInputStream _in;
101 101
102 protected final HttpGenerator _generator; 102 protected final HttpGenerator _generator;
103 final HttpFields _responseFields = new HttpFields(); 103 final HttpFields _responseFields = new HttpFields();
104 protected final Response _response; 104 protected volatile Response _response;
105 private volatile Output _out; 105 private volatile Output _out;
106 private volatile HttpWriter _writer; 106 private volatile HttpWriter _writer;
107 private volatile PrintWriter _printWriter; 107 private volatile PrintWriter _printWriter;
108 108
109 private int _version = -2; // UNKNOWN 109 private int _version = -2; // UNKNOWN
119 protected AbstractHttpConnection(Connector connector, EndPoint endpoint) 119 protected AbstractHttpConnection(Connector connector, EndPoint endpoint)
120 { 120 {
121 super(endpoint); 121 super(endpoint);
122 _connector = connector; 122 _connector = connector;
123 _parser = new HttpParser(_connector.getRequestBuffers(), endpoint, new RequestHandler()); 123 _parser = new HttpParser(_connector.getRequestBuffers(), endpoint, new RequestHandler());
124 _generator = new HttpGenerator(_connector.getResponseBuffers(), endpoint);
125 _server = connector.server;
126 init();
127 }
128
129 private void init() {
124 _request = new Request(this); 130 _request = new Request(this);
125 _response = new Response(this); 131 _response = new Response(this);
126 _generator = new HttpGenerator(_connector.getResponseBuffers(), endpoint);
127 _server = connector.server;
128 } 132 }
129 133
130 public final Connector getConnector() 134 public final Connector getConnector()
131 { 135 {
132 return _connector; 136 return _connector;
223 protected void reset() 227 protected void reset()
224 { 228 {
225 _parser.reset(); 229 _parser.reset();
226 _parser.returnBuffers(); // TODO maybe only on unhandle 230 _parser.returnBuffers(); // TODO maybe only on unhandle
227 _requestFields.clear(); 231 _requestFields.clear();
228 _request.recycle();
229 _generator.reset(); 232 _generator.reset();
230 _generator.returnBuffers();// TODO maybe only on unhandle 233 _generator.returnBuffers();// TODO maybe only on unhandle
231 _responseFields.clear(); 234 _responseFields.clear();
232 _response.recycle();
233 _uri.clear(); 235 _uri.clear();
234 _writer = null; 236 _writer = null;
235 _earlyEOF = false; 237 _earlyEOF = false;
238 init();
236 } 239 }
237 240
238 private void handleRequest() throws IOException 241 private void handleRequest() throws IOException
239 { 242 {
240 boolean error = false; 243 boolean error = false;