public abstract class AbstractInputBuffer<S> extends java.lang.Object implements InputBuffer
Modifier and Type | Field and Description |
---|---|
protected InputFilter[] |
activeFilters
Active filters (in order).
|
protected byte[] |
buf
Pointer to the current read buffer.
|
protected int |
end
Pos of the end of the header in the buffer, which is also the
start of the body.
|
protected InputFilter[] |
filterLibrary
Filter library.
|
protected MimeHeaders |
headers
Headers of the associated request.
|
protected HttpParser |
httpParser |
protected InputBuffer |
inputStreamInputBuffer
Underlying input buffer.
|
protected int |
lastActiveFilter
Index of the last active filter.
|
protected int |
lastValid
Last valid byte.
|
protected boolean |
parsingHeader
State.
|
protected int |
pos
Position in the buffer.
|
protected boolean |
rejectIllegalHeaderName |
protected Request |
request
Associated Coyote request.
|
protected static StringManager |
sm
The string manager for this package.
|
protected boolean |
swallowInput
Swallow input ?
|
Constructor and Description |
---|
AbstractInputBuffer() |
Modifier and Type | Method and Description |
---|---|
void |
addActiveFilter(InputFilter filter)
Add an input filter to the filter library.
|
void |
addFilter(InputFilter filter)
Add an input filter to the filter library.
|
int |
available(boolean read)
Available bytes in the buffers (note that due to encoding, this may not
correspond).
|
int |
doRead(ByteChunk chunk,
Request req)
Read some bytes.
|
void |
endRequest()
End request (consumes leftover bytes).
|
protected abstract boolean |
fill(boolean block)
Attempts to read some data into the input buffer.
|
InputFilter[] |
getFilters()
Get filters.
|
protected abstract Log |
getLog() |
protected abstract void |
init(SocketWrapper<S> socketWrapper,
AbstractEndpoint<S> endpoint) |
protected boolean |
isBlocking()
Is standard Servlet blocking IO being used for input?
|
boolean |
isFinished()
Has all of the request body been read?
|
void |
nextRequest()
End processing of current HTTP request.
|
abstract boolean |
parseHeaders() |
abstract boolean |
parseRequestLine(boolean useAvailableDataOnly)
Implementations are expected to call
Request.setStartTime(long)
as soon as the first byte is read from the request. |
void |
recycle()
Recycle the input buffer.
|
void |
setSwallowInput(boolean swallowInput)
Set the swallow input flag.
|
protected static final StringManager sm
protected Request request
protected MimeHeaders headers
protected boolean parsingHeader
protected boolean swallowInput
protected byte[] buf
protected int lastValid
protected int pos
protected int end
protected InputBuffer inputStreamInputBuffer
protected InputFilter[] filterLibrary
protected InputFilter[] activeFilters
protected int lastActiveFilter
protected boolean rejectIllegalHeaderName
protected HttpParser httpParser
public void addFilter(InputFilter filter)
java.lang.NullPointerException
- if the supplied filter is nullpublic InputFilter[] getFilters()
public void addActiveFilter(InputFilter filter)
public void setSwallowInput(boolean swallowInput)
public abstract boolean parseRequestLine(boolean useAvailableDataOnly) throws java.io.IOException
Request.setStartTime(long)
as soon as the first byte is read from the request.java.io.IOException
public abstract boolean parseHeaders() throws java.io.IOException
java.io.IOException
protected abstract boolean fill(boolean block) throws java.io.IOException
true
if more data was added to the input buffer
otherwise false
java.io.IOException
protected abstract void init(SocketWrapper<S> socketWrapper, AbstractEndpoint<S> endpoint) throws java.io.IOException
java.io.IOException
protected abstract Log getLog()
public void recycle()
public void nextRequest()
public void endRequest() throws java.io.IOException
java.io.IOException
- an underlying I/O error occurredpublic int available(boolean read)
public boolean isFinished()
protected final boolean isBlocking()
public int doRead(ByteChunk chunk, Request req) throws java.io.IOException
doRead
in interface InputBuffer
java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.