comparison src/org/eclipse/jetty/http/HttpParser.java @ 1028:2ea54e6117c3

remove HttpParser.reset()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 00:23:04 -0600
parents cf0367978d8b
children 4e5e9e3c25b3
comparison
equal deleted inserted replaced
1027:6d17a257b03f 1028:2ea54e6117c3
993 } 993 }
994 */ 994 */
995 return _endp.fill(_buffer); 995 return _endp.fill(_buffer);
996 } 996 }
997 997
998 public void reset()
999 {
1000 // reset state
1001 _contentView.setGetIndex(_contentView.putIndex());
1002 _state = _persistent?STATE_START:(_endp.isInputShutdown()?STATE_END:STATE_SEEKING_EOF);
1003 _contentLength = HttpTokens.UNKNOWN_CONTENT;
1004 _contentPosition = 0;
1005 _length = 0;
1006 _responseStatus = 0;
1007
1008 // Consume LF if CRLF
1009 if (_eol == HttpTokens.CARRIAGE_RETURN && _buffer!=null && _buffer.hasContent() && _buffer.peek() == HttpTokens.LINE_FEED)
1010 _eol=_buffer.get();
1011
1012 if (_body!=null && _body.hasContent())
1013 {
1014 // There is content in the body after the end of the request.
1015 // This is probably a pipelined header of the next request, so we need to
1016 // copy it to the header buffer.
1017 if (_header==null)
1018 getHeaderBuffer();
1019 else
1020 {
1021 _header.setMarkIndex(-1);
1022 _header.compact();
1023 }
1024 int take=_header.space();
1025 if (take>_body.length())
1026 take=_body.length();
1027 _body.peek(_body.getIndex(),take);
1028 _body.skip(_header.put(_body.peek(_body.getIndex(),take)));
1029 }
1030
1031 if (_header!=null)
1032 {
1033 _header.setMarkIndex(-1);
1034 _header.compact();
1035 }
1036 if (_body!=null)
1037 _body.setMarkIndex(-1);
1038
1039 _buffer=_header;
1040 returnBuffers();
1041 }
1042
1043
1044 public void returnBuffers() 998 public void returnBuffers()
1045 { 999 {
1046 if (_body!=null && !_body.hasContent() && _body.markIndex()==-1 && _buffers!=null) 1000 if (_body!=null && !_body.hasContent() && _body.markIndex()==-1 && _buffers!=null)
1047 { 1001 {
1048 if (_buffer==_body) 1002 if (_buffer==_body)