Input filter responsible for reading and buffering the request body, so that
it does not interfere with client SSL handshake messages.
| Method from org.apache.coyote.http11.filters.BufferedInputFilter Detail: |
public int available() {
return buffered.getLength();
}
|
public int doRead(ByteChunk chunk,
Request request) throws IOException {
if (hasRead || buffered.getLength() < = 0) {
return -1;
} else {
chunk.setBytes(buffered.getBytes(), buffered.getStart(),
buffered.getLength());
hasRead = true;
}
return chunk.getLength();
}
Fills the given ByteChunk with the buffered request body. |
public long end() throws IOException {
return 0;
}
|
public ByteChunk getEncodingName() {
return ENCODING;
}
|
public void recycle() {
if (buffered.getBuffer().length > 65536) {
buffered = null;
} else {
buffered.recycle();
}
tempRead.recycle();
hasRead = false;
buffer = null;
}
|
public void setBuffer(InputBuffer buffer) {
this.buffer = buffer;
}
|
public void setLimit(int limit) {
// ----------------------------------------------------- Static Initializer
ENCODING.setBytes(ENCODING_NAME.getBytes(), 0, ENCODING_NAME.length());
if (buffered == null) {
buffered = new ByteChunk(4048);
buffered.setLimit(limit);
}
}
Set the buffering limit. This should be reset every time the buffer is
used. |
public void setRequest(Request request) {
// save off the Request body
try {
while (buffer.doRead(tempRead, request) >= 0) {
buffered.append(tempRead);
tempRead.recycle();
}
} catch(IOException iex) {
// Ignore
}
}
Reads the request body and buffers it. |