|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.server.http.AbstractRequest | +--com.caucho.server.http.Request | +--com.caucho.server.http.RunnerRequest
Handles requests from a remote dispatcher. For example, mod_caucho and the IIS plugin use this protocol to talk to the backend.
Packets are straightforward:
code l2 l1 l0 contentsWhere code is the code of the packet and l2-0 give 12 bits of length.
The protocol is designed to allow pipelining and buffering whenever possible. So most commands are not acked. Data from the frontend (POST) does need acks to prevent deadlocks at either end while waiting for new data.
The overriding protocol is controlled by requests from the frontend server.
A ping request:
Frontend Backend CSE_PING CSE_END CSE_ENDA GET request:
Frontend Backend CSE_METHOD ... CSE_HEADER/CSE_VALUE CSE_END CSE_DATA CSE_DATA CSE_ENDShort POST:
Frontend Backend CSE_METHOD ... CSE_HEADER/CSE_VALUE CSE_DATA CSE_END CSE_DATA CSE_DATA CSE_ENDLong POST:
Frontend Backend CSE_METHOD ... CSE_HEADER/CSE_VALUE CSE_DATA CSE_DATA (optional) CSE_DATA CSE_ACK CSE_DATA (optional) CSE_DATA CSE_ACK CSE_END CSE_DATA CSE_END
Field Summary | |
static int |
CSE_ACK
|
static int |
CSE_AUTH_TYPE
|
static int |
CSE_CLIENT_CERT
|
static int |
CSE_CLOSE
|
static int |
CSE_CONTENT_LENGTH
|
static int |
CSE_CONTENT_TYPE
|
static int |
CSE_DATA
|
static int |
CSE_DUMP_SESSION
|
static int |
CSE_END
|
static int |
CSE_FLUSH
|
static int |
CSE_HEADER
|
static int |
CSE_IS_SECURE
|
static int |
CSE_KEEPALIVE
|
static int |
CSE_KILL_SESSION
|
static int |
CSE_LOAD_SESSION
|
static int |
CSE_METHOD
|
static int |
CSE_NULL
|
static int |
CSE_PATH_INFO
|
static int |
CSE_PING
|
static int |
CSE_PROTOCOL
|
static int |
CSE_QUERY
|
static int |
CSE_QUERY_STRING
|
static int |
CSE_REAL_PATH
|
static int |
CSE_REMOTE_ADDR
|
static int |
CSE_REMOTE_HOST
|
static int |
CSE_REMOTE_PORT
|
static int |
CSE_REMOTE_USER
|
static int |
CSE_SAVE_SESSION
|
static int |
CSE_SCRIPT_FILENAME
|
static int |
CSE_SEND_HEADER
|
static int |
CSE_SERVER_NAME
|
static int |
CSE_SERVER_PORT
|
static int |
CSE_SERVER_TYPE
|
static int |
CSE_SESSION_DATA
|
static int |
CSE_SESSION_GROUP
|
static int |
CSE_SESSION_SRUN
|
static int |
CSE_STATUS
|
static int |
CSE_URI
|
static int |
CSE_VALUE
|
Fields inherited from class com.caucho.server.http.Request |
bogusSecure, cb, closeOnExit, conn, currentTransaction, filterStream, hasInputStream, invocationKey, isSecure, rawStream, response, server, sessionGroup, version |
Fields inherited from class com.caucho.server.http.AbstractRequest |
cache, calendar, CONTEXT_PATH, ERROR_URI, EXCEPTION, invocation, JSP_EXCEPTION, MESSAGE, PATH_INFO, QUERY_STRING, REQUEST_URI, SERVLET_PATH, STATUS_CODE |
Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Method Summary | |
CharSegment |
getHeaderBuffer(char[] buf,
int length)
|
CharSegment |
getHeaderBuffer(java.lang.String key)
|
void |
getHeaderBuffers(java.util.ArrayList values,
java.lang.String key)
|
java.util.Enumeration |
getHeaderNames()
Enumerates the header keys |
CharSegment |
getMethodBuffer()
|
CharSegment |
getProtocolBuffer()
|
java.lang.String |
getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request. |
void |
getRemoteAddr(CharBuffer cb)
|
java.lang.String |
getRemoteHost()
Returns the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined. |
java.lang.String |
getRequestURI()
Returns the URI for the request, special casing the IIS issues. |
java.lang.String |
getScheme()
Returns the name of the scheme used to make this request, for example, http , https , or ftp . |
java.lang.String |
getServerName()
Returns the host name of the server that received the request. |
int |
getServerPort()
Returns the port number on which this request was received. |
byte[] |
getUriBuffer()
|
int |
getUriLength()
|
void |
handleConnection(com.caucho.server.Connection conn)
Handle a connection. |
void |
setHeader(java.lang.String key,
java.lang.String value)
|
protected void |
start(ReadStream s)
Clears variables at the start of a new request. |
Methods inherited from class com.caucho.server.http.AbstractRequest |
authenticate, createSession, getAuthType, getCauchoApplication, getDateHeader, getIntHeader, getMedia, getRemoteUser, getRemoteUser, getRequestDepth, getRequestDispatcher, getRequestURL, getSession, getUserPrincipal, isUserInRole, logoutUserPrincipal, setHasCookie |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CSE_NULL
public static final int CSE_PATH_INFO
public static final int CSE_PROTOCOL
public static final int CSE_METHOD
public static final int CSE_QUERY_STRING
public static final int CSE_SERVER_NAME
public static final int CSE_SERVER_PORT
public static final int CSE_REMOTE_HOST
public static final int CSE_REMOTE_ADDR
public static final int CSE_REMOTE_PORT
public static final int CSE_REAL_PATH
public static final int CSE_SCRIPT_FILENAME
public static final int CSE_REMOTE_USER
public static final int CSE_AUTH_TYPE
public static final int CSE_URI
public static final int CSE_CONTENT_LENGTH
public static final int CSE_CONTENT_TYPE
public static final int CSE_IS_SECURE
public static final int CSE_SESSION_GROUP
public static final int CSE_CLIENT_CERT
public static final int CSE_SERVER_TYPE
public static final int CSE_STATUS
public static final int CSE_SEND_HEADER
public static final int CSE_HEADER
public static final int CSE_VALUE
public static final int CSE_DATA
public static final int CSE_FLUSH
public static final int CSE_KEEPALIVE
public static final int CSE_ACK
public static final int CSE_END
public static final int CSE_CLOSE
public static final int CSE_QUERY
public static final int CSE_PING
public static final int CSE_SAVE_SESSION
public static final int CSE_LOAD_SESSION
public static final int CSE_SESSION_DATA
public static final int CSE_KILL_SESSION
public static final int CSE_SESSION_SRUN
public static final int CSE_DUMP_SESSION
Method Detail |
public void handleConnection(com.caucho.server.Connection conn) throws java.io.IOException
com.caucho.server.ServerRequest
conn
- Information about the connection, including buffered
read and write streams.protected void start(ReadStream s) throws java.io.IOException
start
in class Request
com.caucho.server.http.Request
s
- the raw connection streampublic java.lang.String getScheme()
ServletRequest
http
, https
, or ftp
.
Different schemes have different rules for constructing URLs,
as noted in RFC 1738.getScheme
in class Request
javax.servlet.ServletRequest
String
containing the name
of the scheme used to make this requestpublic CharSegment getMethodBuffer()
getMethodBuffer
in class Request
public byte[] getUriBuffer()
getUriBuffer
in class Request
public int getUriLength()
getUriLength
in class Request
public CharSegment getProtocolBuffer()
getProtocolBuffer
in class Request
public CharSegment getHeaderBuffer(java.lang.String key)
getHeaderBuffer
in class Request
public CharSegment getHeaderBuffer(char[] buf, int length)
getHeaderBuffer
in class Request
public void setHeader(java.lang.String key, java.lang.String value)
setHeader
in class Request
public void getHeaderBuffers(java.util.ArrayList values, java.lang.String key)
getHeaderBuffers
in class Request
public java.util.Enumeration getHeaderNames()
Request
getHeaderNames
in class Request
javax.servlet.http.HttpServletRequest
null
public java.lang.String getRequestURI()
getRequestURI
in class Request
javax.servlet.http.HttpServletRequest
String
containing
the part of the URL from the
protocol name up to the query stringHttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)
public java.lang.String getServerName()
ServletRequest
SERVER_NAME
.getServerName
in class Request
javax.servlet.ServletRequest
String
containing the name
of the server to which the request was sentpublic int getServerPort()
ServletRequest
SERVER_PORT
.getServerPort
in class Request
javax.servlet.ServletRequest
public java.lang.String getRemoteAddr()
ServletRequest
REMOTE_ADDR
.getRemoteAddr
in class Request
javax.servlet.ServletRequest
String
containing the
IP address of the client that sent the requestpublic void getRemoteAddr(CharBuffer cb)
public java.lang.String getRemoteHost()
ServletRequest
REMOTE_HOST
.getRemoteHost
in class Request
javax.servlet.ServletRequest
String
containing the fully qualified name
of the client
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |