/**
* Read some bytes.
*/
+ @Override
public int doRead(ByteChunk chunk, Request req)
throws IOException {
* @return number of bytes written
* @throws IOException an underlying I/O error occurred
*/
+ @Override
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
if (org.apache.coyote.Constants.IS_SECURITY_ENABLED){
AccessController.doPrivileged(
new PrivilegedAction<Void>(){
+ @Override
public Void run(){
buf[pos++] = Constants.CR;
buf[pos++] = Constants.LF;
protected ConcurrentHashMap<NioChannel, Http11NioProcessor> connections =
new ConcurrentHashMap<NioChannel, Http11NioProcessor>();
protected ConcurrentLinkedQueue<Http11NioProcessor> recycledProcessors = new ConcurrentLinkedQueue<Http11NioProcessor>() {
+ private static final long serialVersionUID = 1L;
protected AtomicInteger size = new AtomicInteger(0);
@Override
public boolean offer(Http11NioProcessor processor) {
*
* @return Number of bytes read.
*/
+ @Override
public int doRead(ByteChunk chunk, Request unused)
throws IOException;
throws IOException {
while (parseHeader()) {
+ // Loop until there are no more headers
}
parsingHeader = false;
* @return false after reading a blank line (which indicates that the
* HTTP header parsing is done
*/
+ @SuppressWarnings("null") // headerValue cannot be null
public boolean parseHeader()
throws IOException {
}
if (buf[pos] == Constants.CR) {
+ // Skip
} else if (buf[pos] == Constants.LF) {
eol = true;
} else if (buf[pos] == Constants.SP) {
/**
* Read bytes into the specified chunk.
*/
+ @Override
public int doRead(ByteChunk chunk, Request req )
throws IOException {
/**
* Write chunk.
*/
+ @Override
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
throws IOException {
while (parseHeader()) {
+ // Loop until we run out of headers
}
parsingHeader = false;
* @return false after reading a blank line (which indicates that the
* HTTP header parsing is done
*/
+ @SuppressWarnings("null") // headerValue cannot be null
public boolean parseHeader()
throws IOException {
}
if (buf[pos] == Constants.CR) {
+ // Skip
} else if (buf[pos] == Constants.LF) {
eol = true;
} else if (buf[pos] == Constants.SP) {
/**
* Read bytes into the specified chunk.
*/
+ @Override
public int doRead(ByteChunk chunk, Request req )
throws IOException {
socket.getBufHandler().getReadBuffer().clear();
if ( block ) {
Selector selector = null;
- try { selector = getSelectorPool().get(); }catch ( IOException x ) {}
+ try {
+ selector = getSelectorPool().get();
+ } catch ( IOException x ) {
+ // Ignore
+ }
try {
NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
if ( att == null ) throw new IOException("Key must be cancelled.");
}
if (buf[pos] == Constants.CR) {
+ // Skip
} else if (buf[pos] == Constants.LF) {
eol = true;
} else if (buf[pos] == Constants.SP) {
/**
* Read bytes into the specified chunk.
*/
+ @Override
public int doRead(ByteChunk chunk, Request req )
throws IOException {
/**
* Write chunk.
*/
+ @Override
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
/**
* Callback to write data from the buffer.
*/
+ @Override
public void realWriteBytes(byte cbuf[], int off, int len)
throws IOException {
if (len > 0) {
/**
* Write chunk.
*/
+ @Override
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
*
* @return number of bytes written by the filter
*/
+ @Override
public int doWrite(ByteChunk chunk, Response unused)
throws IOException;