comparison src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 1001:39154cfa58e4

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 22 Oct 2016 20:56:41 -0600
parents 74b9daf2826c
children 0e96ce3db20a
comparison
equal deleted inserted replaced
1000:32d4b569567c 1001:39154cfa58e4
90 */ 90 */
91 public abstract class AbstractHttpConnection extends AbstractConnection 91 public abstract class AbstractHttpConnection extends AbstractConnection
92 { 92 {
93 private static final Logger LOG = LoggerFactory.getLogger(AbstractHttpConnection.class); 93 private static final Logger LOG = LoggerFactory.getLogger(AbstractHttpConnection.class);
94 94
95 private int _requests;
96
97 private final Connector _connector; 95 private final Connector _connector;
98 private final Server _server; 96 private final Server _server;
99 protected final HttpURI _uri = StringUtil.__UTF8.equals(URIUtil.__CHARSET)?new HttpURI():new EncodedHttpURI(URIUtil.__CHARSET); 97 protected final HttpURI _uri = StringUtil.__UTF8.equals(URIUtil.__CHARSET)?new HttpURI():new EncodedHttpURI(URIUtil.__CHARSET);
100 98
101 protected final HttpParser _parser; 99 protected final HttpParser _parser;
102 protected final HttpFields _requestFields = new HttpFields(); 100 protected final HttpFields _requestFields = new HttpFields();
103 private final Request _request; 101 public final Request _request;
104 private volatile ServletInputStream _in; 102 private volatile ServletInputStream _in;
105 103
106 protected final HttpGenerator _generator; 104 protected final HttpGenerator _generator;
107 final HttpFields _responseFields = new HttpFields(); 105 final HttpFields _responseFields = new HttpFields();
108 protected final Response _response; 106 protected final Response _response;
287 _request.setPathInfo(info); 285 _request.setPathInfo(info);
288 286
289 if (_out!=null) 287 if (_out!=null)
290 _out.reopen(); 288 _out.reopen();
291 289
292 _connector.customize(_endp, _request); 290 _connector.customize(this);
293 _server.handle(this); 291 _server.handle(this);
294 } 292 }
295 catch (EofException e) 293 catch (EofException e)
296 { 294 {
297 LOG.debug("",e); 295 LOG.debug("",e);
441 } 439 }
442 440
443 @Override 441 @Override
444 public String toString() 442 public String toString()
445 { 443 {
446 return String.format("%s,g=%s,p=%s,r=%d", 444 return String.format("%s,g=%s,p=%s",
447 super.toString(), 445 super.toString(),
448 _generator, 446 _generator,
449 _parser, 447 _parser);
450 _requests);
451 } 448 }
452 449
453 private void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException 450 private void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException
454 { 451 {
455 uri=uri.asImmutableBuffer(); 452 uri=uri.asImmutableBuffer();
572 { 569 {
573 _endp.close(); 570 _endp.close();
574 return; 571 return;
575 } 572 }
576 573
577 _requests++;
578 _generator.setVersion(_version); 574 _generator.setVersion(_version);
579 switch (_version) 575 switch (_version)
580 { 576 {
581 case HttpVersions.HTTP_0_9_ORDINAL: 577 case HttpVersions.HTTP_0_9_ORDINAL:
582 break; 578 break;