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;
}
+
+ chunk.setBytes(buffered.getBytes(), buffered.getStart(),
+ buffered.getLength());
+ hasRead = true;
return chunk.getLength();
}
* Read the content length from the request.
*/
public void setRequest(Request request) {
+ // NOOP: Request isn't used so ignore it
}
// Consume extra bytes : parse the stream until the end chunk is found
while (doRead(readChunk, null) >= 0) {
+ // NOOP: Just consume the input
}
// Return the number of extra bytes which were consumed
}
if (buf[pos] == Constants.CR) {
+ // FIXME: Improve parsing to check for CRLF
} else if (buf[pos] == Constants.LF) {
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
* after the response header processing is complete.
*/
public void setResponse(Response response) {
+ // NOOP: No need for parameters from response in this filter
}
* Make the filter ready to process the next request.
*/
public void recycle() {
+ // NOOP: Nothing to recycle
}
* after the response header processing is complete.
*/
public void setResponse(Response response) {
+ // NOOP: No need for parameters from response in this filter
}
buffer.doWrite(outputChunk, null);
}
@Override
- public void flush() throws IOException {}
+ public void flush() throws IOException {/*NOOP*/}
@Override
- public void close() throws IOException {}
+ public void close() throws IOException {/*NOOP*/}
}
* Set the next buffer in the filter pipeline (has no effect).
*/
public void setBuffer(InputBuffer buffer) {
+ // NOOP since this filter will be providing the request body
}
/**
* Set the associated request.
*/
public void setRequest(Request request) {
+ // NOOP: Request isn't used so ignore it
}
* Set the next buffer in the filter pipeline.
*/
public void setBuffer(InputBuffer buffer) {
+ // NOOP: No body to read
}
* Make the filter ready to process the next request.
*/
public void recycle() {
+ // NOOP: Nothing to recycle
}
* after the response header processing is complete.
*/
public void setResponse(Response response) {
+ // NOOP: No need for parameters from response in this filter
}
* Make the filter ready to process the next request.
*/
public void recycle() {
+ // NOOP: Nothing to recycle
}