// -------------------- debug --------------------
+ @Override
public String toString() {
return "R( " + requestURI().toString() + ")";
}
protected ConcurrentLinkedQueue<AjpAprProcessor> recycledProcessors =
new ConcurrentLinkedQueue<AjpAprProcessor>() {
protected AtomicInteger size = new AtomicInteger(0);
+ @Override
public boolean offer(AjpAprProcessor processor) {
boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
//avoid over growing our cache or add after we have stopped
return result;
}
+ @Override
public AjpAprProcessor poll() {
AjpAprProcessor result = super.poll();
if ( result != null ) {
return result;
}
+ @Override
public void clear() {
AjpAprProcessor next = poll();
while ( next != null ) {
protected ConcurrentLinkedQueue<AjpProcessor> recycledProcessors =
new ConcurrentLinkedQueue<AjpProcessor>() {
protected AtomicInteger size = new AtomicInteger(0);
+ @Override
public boolean offer(AjpProcessor processor) {
boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
//avoid over growing our cache or add after we have stopped
return result;
}
+ @Override
public AjpProcessor poll() {
AjpProcessor result = super.poll();
if ( result != null ) {
return result;
}
+ @Override
public void clear() {
AjpProcessor next = poll();
while ( next != null ) {
protected ConcurrentLinkedQueue<Http11AprProcessor> recycledProcessors =
new ConcurrentLinkedQueue<Http11AprProcessor>() {
protected AtomicInteger size = new AtomicInteger(0);
+ @Override
public boolean offer(Http11AprProcessor processor) {
boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
//avoid over growing our cache or add after we have stopped
return result;
}
+ @Override
public Http11AprProcessor poll() {
Http11AprProcessor result = super.poll();
if ( result != null ) {
return result;
}
+ @Override
public void clear() {
Http11AprProcessor next = poll();
while ( next != null ) {
* Specialized utility method: find a sequence of lower case bytes inside
* a ByteChunk.
*/
+ @Override
protected int findBytes(ByteChunk bc, byte[] b) {
byte first = b[0];
* Determine if we must drop the connection because of the HTTP status
* code. Use the same list of codes as Apache/httpd.
*/
+ @Override
protected boolean statusDropsConnection(int status) {
return status == 400 /* SC_BAD_REQUEST */ ||
status == 408 /* SC_REQUEST_TIMEOUT */ ||
new ConcurrentHashMap<NioChannel, Http11NioProcessor>();
protected ConcurrentLinkedQueue<Http11NioProcessor> recycledProcessors = new ConcurrentLinkedQueue<Http11NioProcessor>() {
protected AtomicInteger size = new AtomicInteger(0);
+ @Override
public boolean offer(Http11NioProcessor processor) {
boolean offer = proto.processorCache==-1?true:size.get() < proto.processorCache;
//avoid over growing our cache or add after we have stopped
return result;
}
+ @Override
public Http11NioProcessor poll() {
Http11NioProcessor result = super.poll();
if ( result != null ) {
return result;
}
+ @Override
public void clear() {
Http11NioProcessor next = poll();
while ( next != null ) {
* Set the socket buffer flag.
* @Override
*/
+ @Override
public void setSocketBuffer(int socketBuffer) {
super.setSocketBuffer(socketBuffer);
outputBuffer.setSocketBuffer(socketBuffer);
protected ConcurrentLinkedQueue<Http11Processor> recycledProcessors =
new ConcurrentLinkedQueue<Http11Processor>() {
protected AtomicInteger size = new AtomicInteger(0);
+ @Override
public boolean offer(Http11Processor processor) {
boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
//avoid over growing our cache or add after we have stopped
return result;
}
+ @Override
public Http11Processor poll() {
Http11Processor result = super.poll();
if ( result != null ) {
return result;
}
+ @Override
public void clear() {
Http11Processor next = poll();
while ( next != null ) {
* read operations, or if the given buffer is not big enough to accomodate
* the whole line.
*/
+ @Override
public boolean parseRequestLine(boolean useAvailableDataOnly)
throws IOException {
/**
* Parse the HTTP headers.
*/
+ @Override
public boolean parseHeaders()
throws IOException {
return fill(true);
}
+ @Override
protected boolean fill(boolean block) throws IOException {
int nRead = 0;
* Recycle the input buffer. This should be called when closing the
* connection.
*/
+ @Override
public void recycle() {
super.recycle();
// Recycle filters
* consumed. This method only resets all the pointers so that we are ready
* to parse the next HTTP request.
*/
+ @Override
public void nextRequest() {
super.nextRequest();
parsingHeader = true;
* @return true if data is properly fed; false if no data is available
* immediately and thread should be freed
*/
+ @Override
public boolean parseRequestLine(boolean useAvailableDataOnly)
throws IOException {
/**
* Parse the HTTP headers.
*/
+ @Override
public boolean parseHeaders()
throws IOException {
HeaderParseStatus status = HeaderParseStatus.HAVE_MORE_HEADERS;
*
* @return false if at end of stream
*/
+ @Override
protected boolean fill(boolean block) throws IOException, EOFException {
return fill(true,block);
}
/**
* Send an acknoledgement.
*/
+ @Override
public void sendAck() throws IOException {
if (!committed) {
*
* @throws IOException an undelying I/O error occured
*/
+ @Override
protected void commit()
throws IOException {
*
* @throws IOException an underlying I/O error occurred
*/
+ @Override
public void flush()
throws IOException {
* Recycle the output buffer. This should be called when closing the
* connection.
*/
+ @Override
public void recycle() {
super.recycle();
socketBuffer.recycle();
* consumed. This method only resets all the pointers so that we are ready
* to parse the next HTTP request.
*/
+ @Override
public void nextRequest() {
super.nextRequest();
socketBuffer.recycle();
*
* @throws IOException an underlying I/O error occurred
*/
+ @Override
public void endRequest()
throws IOException {
super.endRequest();
/**
* Send an acknoledgement.
*/
+ @Override
public void sendAck()
throws IOException {
*
* @throws IOException an undelying I/O error occured
*/
+ @Override
protected void commit()
throws IOException {
extends OutputStream {
protected ByteChunk outputChunk = new ByteChunk();
protected byte[] singleByteBuffer = new byte[1];
+ @Override
public void write(int b)
throws IOException {
// Shouldn't get used for good performance, but is needed for
outputChunk.setBytes(singleByteBuffer, 0, 1);
buffer.doWrite(outputChunk, null);
}
+ @Override
public void write(byte[] b, int off, int len)
throws IOException {
outputChunk.setBytes(b, off, len);
buffer.doWrite(outputChunk, null);
}
+ @Override
public void flush() throws IOException {}
+ @Override
public void close() throws IOException {}
}