comparison src/org/eclipse/jetty/http/HttpParser.java @ 1065:158d1e6ac17f

fix JBuffer.compact()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 09 Nov 2016 04:36:05 -0700
parents 0157e92670f5
children 9d357b9e4bcb
comparison
equal deleted inserted replaced
1064:a0abb16cf6e7 1065:158d1e6ac17f
96 _mark = -1; 96 _mark = -1;
97 return BufferUtil.getString(buf); 97 return BufferUtil.getString(buf);
98 } 98 }
99 99
100 private void clear() { 100 private void clear() {
101 _buffer.clear(); 101 _buffer.limit(0);
102 _mark = -1; 102 _mark = -1;
103 } 103 }
104 104
105 private void compact() { 105 private void compact() {
106 if( _mark == -1 ) { 106 if( _mark == -1 ) {
107 _buffer.compact(); 107 BufferUtil.compact(_buffer);
108 } else if( _mark > 0 ) { 108 } else if( _mark > 0 ) {
109 int old = _buffer.position(); 109 int old = _buffer.position();
110 _buffer.position(_mark); 110 _buffer.position(_mark);
111 _buffer.compact(); 111 BufferUtil.compact(_buffer);
112 _buffer.position( old - _mark ); 112 _buffer.position( old - _mark );
113 _mark = 0; 113 _mark = 0;
114 } 114 }
115 } 115 }
116 116