comparison src/org/eclipse/jetty/http/HttpGenerator.java @ 1034:563458c4dc93

remove HttpGenerator.reset()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 21:02:59 -0600
parents 3718afd99988
children b87f97f6418a
comparison
equal deleted inserted replaced
1033:4ada7a8c128a 1034:563458c4dc93
104 public HttpGenerator(Buffers buffers, EndPoint io) 104 public HttpGenerator(Buffers buffers, EndPoint io)
105 { 105 {
106 super(buffers,io); 106 super(buffers,io);
107 } 107 }
108 108
109 @Override 109 public void shutdown() {
110 public void reset()
111 {
112 if (_persistent!=null && !_persistent && _endp!=null && !_endp.isOutputShutdown()) 110 if (_persistent!=null && !_persistent && _endp!=null && !_endp.isOutputShutdown())
113 { 111 {
114 try 112 try
115 { 113 {
116 _endp.shutdownOutput(); 114 _endp.shutdownOutput();
118 catch(IOException e) 116 catch(IOException e)
119 { 117 {
120 LOG.trace("",e); 118 LOG.trace("",e);
121 } 119 }
122 } 120 }
123 super.reset();
124 if (_buffer!=null)
125 _buffer.clear();
126 if (_header!=null)
127 _header.clear();
128 if (_content!=null)
129 _content=null;
130 _bypass = false;
131 _needCRLF = false;
132 _needEOC = false;
133 _bufferChunked = false;
134 _method=null;
135 _uri=null;
136 _noContent=false;
137 } 121 }
138 122
139 /* ------------------------------------------------------------ */ 123 /* ------------------------------------------------------------ */
140 /** 124 /**
141 * Add content. 125 * Add content.
328 312
329 try 313 try
330 { 314 {
331 if (isRequest()) 315 if (isRequest())
332 { 316 {
333 _persistent=true; 317 _persistent = true;
334 318
335 if (_version == HttpVersions.HTTP_0_9_ORDINAL) 319 if (_version == HttpVersions.HTTP_0_9_ORDINAL)
336 { 320 {
337 _contentLength = HttpTokens.NO_CONTENT; 321 _contentLength = HttpTokens.NO_CONTENT;
338 _header.put(_method); 322 _header.put(_method);
364 return; 348 return;
365 } 349 }
366 else 350 else
367 { 351 {
368 if (_persistent==null) 352 if (_persistent==null)
369 _persistent= (_version > HttpVersions.HTTP_1_0_ORDINAL); 353 _persistent = (_version > HttpVersions.HTTP_1_0_ORDINAL);
370 354
371 // add response line 355 // add response line
372 Status status = _status<__status.length?__status[_status]:null; 356 Status status = _status<__status.length?__status[_status]:null;
373 357
374 if (status==null) 358 if (status==null)
491 switch(ord) 475 switch(ord)
492 { 476 {
493 case HttpHeaderValues.CLOSE_ORDINAL: 477 case HttpHeaderValues.CLOSE_ORDINAL:
494 close=true; 478 close=true;
495 if (isResponse()) 479 if (isResponse())
496 _persistent=false; 480 _persistent = false;
497 keep_alive=false; 481 keep_alive=false;
498 if (!_persistent && isResponse() && _contentLength == HttpTokens.UNKNOWN_CONTENT) 482 if (!_persistent && isResponse() && _contentLength == HttpTokens.UNKNOWN_CONTENT)
499 _contentLength = HttpTokens.EOF_CONTENT; 483 _contentLength = HttpTokens.EOF_CONTENT;
500 break; 484 break;
501 485