| Method from org.apache.coyote.tomcat3.Tomcat3Request Detail: |
public int doRead() throws IOException {
if( available == 0 )
return -1;
// #3745
// if available == -1: unknown length, we'll read until end of stream.
if( available!= -1 )
available--;
if(pos >= end) {
if(readBytes() < 0)
return -1;
}
return readBuffer[pos++] & 0xFF;
}
Read a single character from the request body. |
public int doRead(byte[] b,
int off,
int len) throws IOException {
if( available == 0 )
return -1;
// if available == -1: unknown length, we'll read until end of stream.
if(pos >= end) {
if(readBytes() < = 0)
return -1;
}
int rd = -1;
if((end - pos) > len) {
rd = len;
} else {
rd = end - pos;
}
System.arraycopy(readBuffer, pos, b, off, rd);
pos += rd;
if( available!= -1 )
available -= rd;
return rd;
}
Read a chunk from the request body. |
public String getAuthType() {
return coyoteRequest.getAuthType().toString();
}
|
BaseInterceptor getConnector() {
return connector;
}
Get the Connector that this request services |
public Request getCoyoteRequest() {
return coyoteRequest;
}
|
public String getJvmRoute() {
return coyoteRequest.instanceId().toString();
}
|
public String getLocalHost() {
return localHost;
}
|
public String getRemoteUser() {
String s=coyoteRequest.getRemoteUser().toString();
if( s == null )
s=super.getRemoteUser();
return s;
}
|
public int getServerPort() {
return coyoteRequest.getServerPort();
}
|
public boolean isSecure() {
return "https".equalsIgnoreCase( coyoteRequest.scheme().toString());
}
|
protected int readBytes() throws IOException {
int result = coyoteRequest.doRead(readChunk);
if (result > 0) {
readBuffer = readChunk.getBytes();
end = readChunk.getEnd();
pos = readChunk.getStart();
} else if( result < 0 ) {
throw new IOException( "Read bytes failed " + result );
}
return result;
}
Read bytes to the read chunk buffer. |
public void recycle() {
super.recycle();
if( coyoteRequest != null) coyoteRequest.recycle();
remoteAddrMB.recycle();
remoteHostMB.recycle();
readChunk.recycle();
readBuffer=null;
pos=-1;
end=-1;
}
|
public MessageBytes remoteAddr() {
if( remoteAddrMB.isNull() ) {
coyoteRequest.action( ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE, coyoteRequest );
}
return remoteAddrMB;
}
|
public MessageBytes remoteHost() {
if( remoteHostMB.isNull() ) {
coyoteRequest.action( ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest );
}
return remoteHostMB;
}
|
public MessageBytes serverName() {
// That's set by protocol in advance, it's needed for mapping anyway,
// no need to do lazy eval.
return coyoteRequest.serverName();
}
|
public void setAuthType(String s) {
coyoteRequest.getAuthType().setString(s);
}
|
void setConnector(BaseInterceptor conn) {
connector = conn;
}
Set the Connector that this request services |
public void setCoyoteRequest(Request cReq) {
coyoteRequest=cReq;
// The CoyoteRequest/Tomcat3Request are bound togheter, they
// don't change. That means we can use the same field ( which
// doesn't change as well.
schemeMB = coyoteRequest.scheme();
methodMB = coyoteRequest.method();
uriMB = coyoteRequest.requestURI();
queryMB = coyoteRequest.query();
protoMB = coyoteRequest.protocol();
headers = coyoteRequest.getMimeHeaders();
scookies.setHeaders(headers);
params.setHeaders(headers);
params.setQuery( queryMB );
remoteAddrMB = coyoteRequest.remoteAddr();
remoteHostMB = coyoteRequest.remoteHost();
serverNameMB = coyoteRequest.serverName();
}
Attach the Coyote Request to this Request.
This is currently set pre-request to allow copying the request
attributes to the Tomcat attributes. |
public void setJvmRoute(String s) {
coyoteRequest.instanceId().setString(s);
}
|
public void setRemoteUser(String s) {
super.setRemoteUser(s);
coyoteRequest.getRemoteUser().setString(s);
}
|
public void setServerPort(int i) {
coyoteRequest.setServerPort( i );
}
|