| |
|
| java.lang.Object com.caucho.server.connection.AbstractHttpRequest com.caucho.server.hmux.HmuxRequest
HmuxRequest | public class HmuxRequest extends AbstractHttpRequest implements ServerRequest(Code) | | 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 contents
Where 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_END
A GET request:
Frontend Backend
CSE_METHOD
...
CSE_HEADER/CSE_VALUE
CSE_END
CSE_DATA
CSE_DATA
CSE_END
Short POST:
Frontend Backend
CSE_METHOD
...
CSE_HEADER/CSE_VALUE
CSE_DATA
CSE_END
CSE_DATA
CSE_DATA
CSE_END
Long 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
|
Inner Class :public enum ProtocolResult | |
Inner Class :static class ServletFilter extends StreamImpl | |
Method Summary | |
protected boolean | checkLogin() | protected void | connectionClose() | final public String | dbgId() | public String | getHeader(String key) Returns the header. | public CharSegment | getHeaderBuffer(String key) | public CharSegment | getHeaderBuffer(char[] buf, int length) | public void | getHeaderBuffers(String key, ArrayList<CharSegment> values) | public Enumeration | getHeaderNames() | protected CharBuffer | getHost() Returns a char buffer containing the host. | public String | getMethod() Returns the header. | public CharSegment | getMethodBuffer() | public String | getProtocol() Returns the protocol. | public CharSegment | getProtocolBuffer() | public String | getRemoteAddr() | public void | getRemoteAddr(CharBuffer cb) | public String | getRemoteHost() | public String | getRequestURI() Returns the URI for the request, special casing the IIS issues. | public String | getServerName() Returns the server name. | public int | getServerPort() | final public byte[] | getUriBuffer() | final public int | getUriLength() | final int | getVersion() | public boolean | handleRequest() Handles a new request. | protected boolean | initStream(ReadStream readStream, ReadStream rawStream) Initialize the read stream from the raw stream. | public boolean | isSecure() Returns true if the request is secure. | public boolean | isTop() | public boolean | isWaitForRead() | public int | printRemoteAddr(byte[] buffer, int offset) | public void | protocolCloseEvent() | void | sendHeader() Complete sending of all headers. | public void | setHeader(String key, String value) | protected void | start() Clears variables at the start of a new request. | public String | toString() | void | writeHeader(String key, String value) Writes a header to the plugin. | void | writeHeader(String key, CharBuffer value) Writes a header to the plugin. | void | writeStatus(CharBuffer message) | void | writeString(int code, String value) | void | writeString(int code, CharBuffer cb) |
CSE_ACK | final public static int CSE_ACK(Code) | | |
CSE_AUTH_TYPE | final public static int CSE_AUTH_TYPE(Code) | | |
CSE_CLIENT_CERT | final public static int CSE_CLIENT_CERT(Code) | | |
CSE_CLOSE | final public static int CSE_CLOSE(Code) | | |
CSE_CONTENT_LENGTH | final public static int CSE_CONTENT_LENGTH(Code) | | |
CSE_CONTENT_TYPE | final public static int CSE_CONTENT_TYPE(Code) | | |
CSE_DATA | final public static int CSE_DATA(Code) | | |
CSE_END | final public static int CSE_END(Code) | | |
CSE_FLUSH | final public static int CSE_FLUSH(Code) | | |
CSE_IS_SECURE | final public static int CSE_IS_SECURE(Code) | | |
CSE_KEEPALIVE | final public static int CSE_KEEPALIVE(Code) | | |
CSE_NULL | final public static int CSE_NULL(Code) | | |
CSE_PATH_INFO | final public static int CSE_PATH_INFO(Code) | | |
CSE_PING | final public static int CSE_PING(Code) | | |
CSE_PROTOCOL | final public static int CSE_PROTOCOL(Code) | | |
CSE_QUERY | final public static int CSE_QUERY(Code) | | |
CSE_QUERY_STRING | final public static int CSE_QUERY_STRING(Code) | | |
CSE_REAL_PATH | final public static int CSE_REAL_PATH(Code) | | |
CSE_REMOTE_ADDR | final public static int CSE_REMOTE_ADDR(Code) | | |
CSE_REMOTE_HOST | final public static int CSE_REMOTE_HOST(Code) | | |
CSE_REMOTE_PORT | final public static int CSE_REMOTE_PORT(Code) | | |
CSE_REMOTE_USER | final public static int CSE_REMOTE_USER(Code) | | |
CSE_SCRIPT_FILENAME | final public static int CSE_SCRIPT_FILENAME(Code) | | |
CSE_SEND_HEADER | final public static int CSE_SEND_HEADER(Code) | | |
CSE_SERVER_PORT | final public static int CSE_SERVER_PORT(Code) | | |
CSE_SERVER_TYPE | final public static int CSE_SERVER_TYPE(Code) | | |
CSE_URI | final public static int CSE_URI(Code) | | |
HMUX_ACK | final public static int HMUX_ACK(Code) | | |
HMUX_CHANNEL | final public static int HMUX_CHANNEL(Code) | | |
HMUX_CLUSTER_PROTOCOL | final public static int HMUX_CLUSTER_PROTOCOL(Code) | | |
HMUX_DATA | final public static int HMUX_DATA(Code) | | |
HMUX_DISPATCH_PROTOCOL | final public static int HMUX_DISPATCH_PROTOCOL(Code) | | |
HMUX_ERROR | final public static int HMUX_ERROR(Code) | | |
HMUX_EXIT | final public static int HMUX_EXIT(Code) | | |
HMUX_FLUSH | final public static int HMUX_FLUSH(Code) | | |
HMUX_HEADER | final public static int HMUX_HEADER(Code) | | |
HMUX_JMS_PROTOCOL | final public static int HMUX_JMS_PROTOCOL(Code) | | |
HMUX_META_HEADER | final public static int HMUX_META_HEADER(Code) | | |
HMUX_METHOD | final public static int HMUX_METHOD(Code) | | |
HMUX_PROTOCOL | final public static int HMUX_PROTOCOL(Code) | | |
HMUX_QUIT | final public static int HMUX_QUIT(Code) | | |
HMUX_SERVER_NAME | final public static int HMUX_SERVER_NAME(Code) | | |
HMUX_STATUS | final public static int HMUX_STATUS(Code) | | |
HMUX_STRING | final public static int HMUX_STRING(Code) | | |
HMUX_URI | final public static int HMUX_URI(Code) | | |
HMUX_YIELD | final public static int HMUX_YIELD(Code) | | |
HTTP_0_9 | final static int HTTP_0_9(Code) | | |
HTTP_1_0 | final static int HTTP_1_0(Code) | | |
HTTP_1_1 | final static int HTTP_1_1(Code) | | |
_getCb | final static CharBuffer _getCb(Code) | | |
_headCb | final static CharBuffer _headCb(Code) | | |
_postCb | final static CharBuffer _postCb(Code) | | |
checkLogin | protected boolean checkLogin()(Code) | | |
connectionClose | protected void connectionClose()(Code) | | Called for a connection: close
|
getHeaderBuffer | public CharSegment getHeaderBuffer(String key)(Code) | | |
getHeaderBuffer | public CharSegment getHeaderBuffer(char[] buf, int length)(Code) | | |
getHost | protected CharBuffer getHost()(Code) | | Returns a char buffer containing the host.
|
getMethod | public String getMethod()(Code) | | Returns the header.
|
getMethodBuffer | public CharSegment getMethodBuffer()(Code) | | |
getProtocol | public String getProtocol()(Code) | | Returns the protocol.
|
getProtocolBuffer | public CharSegment getProtocolBuffer()(Code) | | |
getRemoteAddr | public void getRemoteAddr(CharBuffer cb)(Code) | | |
getRequestURI | public String getRequestURI()(Code) | | Returns the URI for the request, special casing the IIS issues.
Because IIS already escapes the URI before sending it, the URI
needs to be re-escaped.
|
getServerName | public String getServerName()(Code) | | Returns the server name.
|
getServerPort | public int getServerPort()(Code) | | |
getUriBuffer | final public byte[] getUriBuffer()(Code) | | |
getUriLength | final public int getUriLength()(Code) | | |
getVersion | final int getVersion()(Code) | | |
handleRequest | public boolean handleRequest() throws IOException(Code) | | Handles a new request. Initializes the protocol handler and
the request streams.
Note: ClientDisconnectException must be rethrown to
the caller.
|
initStream | protected boolean initStream(ReadStream readStream, ReadStream rawStream) throws IOException(Code) | | Initialize the read stream from the raw stream.
|
isSecure | public boolean isSecure()(Code) | | Returns true if the request is secure.
|
isTop | public boolean isTop()(Code) | | Returns true for the top-level request, but false for any include()
or forward()
|
isWaitForRead | public boolean isWaitForRead()(Code) | | |
printRemoteAddr | public int printRemoteAddr(byte[] buffer, int offset) throws IOException(Code) | | |
protocolCloseEvent | public void protocolCloseEvent()(Code) | | |
sendHeader | void sendHeader() throws IOException(Code) | | Complete sending of all headers.
|
start | protected void start() throws IOException(Code) | | Clears variables at the start of a new request.
|
writeHeader | void writeHeader(String key, String value) throws IOException(Code) | | Writes a header to the plugin.
Parameters: key - the header's key Parameters: value - the header's value |
writeHeader | void writeHeader(String key, CharBuffer value) throws IOException(Code) | | Writes a header to the plugin.
Parameters: key - the header's key Parameters: value - the header's value |
Methods inherited from com.caucho.server.connection.AbstractHttpRequest | public void addCloseOnExit(Path path)(Code)(Java Doc) protected boolean addHeaderInt(char[] keyBuf, int keyOff, int keyLen, CharSegment value)(Code)(Java Doc) public boolean allowKeepalive()(Code)(Java Doc) public boolean authenticate() throws ServletException, IOException(Code)(Java Doc) public void cleanup()(Code)(Java Doc) protected void connectionClose()(Code)(Java Doc) protected String dbgId()(Code)(Java Doc) public String findSessionIdFromConnection()(Code)(Java Doc) public void finish() throws IOException(Code)(Java Doc) public Object getAttribute(String name)(Code)(Java Doc) public Enumeration<String> getAttributeNames()(Code)(Java Doc) public String getAuthType()(Code)(Java Doc) public String getCharacterEncoding()(Code)(Java Doc) final public Connection getConnection()(Code)(Java Doc) public int getContentLength()(Code)(Java Doc) public String getContentType()(Code)(Java Doc) public CharSegment getContentTypeBuffer()(Code)(Java Doc) public String getContextPath()(Code)(Java Doc) public Cookie getCookie(String name)(Code)(Java Doc) public Cookie[] getCookies()(Code)(Java Doc) public long getDateHeader(String key)(Code)(Java Doc) final public DispatchServer getDispatchServer()(Code)(Java Doc) public boolean getHasCookie()(Code)(Java Doc) abstract public String getHeader(String key)(Code)(Java Doc) public CharSegment getHeaderBuffer(String name)(Code)(Java Doc) public void getHeaderBuffers(String name, ArrayList<CharSegment> resultList)(Code)(Java Doc) public CharSegment getHeaderKey(int index)(Code)(Java Doc) abstract public Enumeration getHeaderNames()(Code)(Java Doc) public int getHeaderSize()(Code)(Java Doc) public CharSegment getHeaderValue(int index)(Code)(Java Doc) public Enumeration getHeaders(String name)(Code)(Java Doc) protected CharSequence getHost()(Code)(Java Doc) public ServletInputStream getInputStream() throws IOException(Code)(Java Doc) public int getIntHeader(String key)(Code)(Java Doc) final public Invocation getInvocation()(Code)(Java Doc) public HttpSession getLoadedSession()(Code)(Java Doc) public String getLocalAddr()(Code)(Java Doc) public String getLocalName()(Code)(Java Doc) public int getLocalPort()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Enumeration<Locale> getLocales()(Code)(Java Doc) final public byte[] getLogBuffer()(Code)(Java Doc) public long getLongContentLength()(Code)(Java Doc) public HttpSession getMemorySession()(Code)(Java Doc) abstract public String getMethod()(Code)(Java Doc) public String getPageContextPath()(Code)(Java Doc) public String getPagePathInfo()(Code)(Java Doc) public String getPageQueryString()(Code)(Java Doc) public String getPageServletPath()(Code)(Java Doc) public String getPageURI()(Code)(Java Doc) public String getParameter(String name)(Code)(Java Doc) public Map<String, String[]> getParameterMap()(Code)(Java Doc) public Enumeration<String> getParameterNames()(Code)(Java Doc) public String[] getParameterValues(String name)(Code)(Java Doc) public String getPathInfo()(Code)(Java Doc) public String getPathTranslated()(Code)(Java Doc) abstract public String getProtocol()(Code)(Java Doc) public String getQueryString()(Code)(Java Doc) public ReadStream getRawInput()(Code)(Java Doc) public byte[] getRawReadBuffer()(Code)(Java Doc) public BufferedReader getReader() throws IOException(Code)(Java Doc) public String getRealPath(String path)(Code)(Java Doc) public String getRemoteAddr()(Code)(Java Doc) public String getRemoteHost()(Code)(Java Doc) public int getRemotePort()(Code)(Java Doc) public String getRemoteUser(boolean create)(Code)(Java Doc) public String getRemoteUser()(Code)(Java Doc) public int getRequestDepth(int depth)(Code)(Java Doc) public int getRequestDepth()(Code)(Java Doc) public RequestDispatcher getRequestDispatcher(String path)(Code)(Java Doc) public String getRequestURI()(Code)(Java Doc) public StringBuffer getRequestURL()(Code)(Java Doc) public String getRequestedSessionId()(Code)(Java Doc) public String getRequestedSessionIdNoVary()(Code)(Java Doc) public CauchoResponse getResponse()(Code)(Java Doc) public String getScheme()(Code)(Java Doc) public String getServerName()(Code)(Java Doc) public int getServerPort()(Code)(Java Doc) public String getServletName()(Code)(Java Doc) public String getServletPath()(Code)(Java Doc) public HttpSession getSession()(Code)(Java Doc) public HttpSession getSession(boolean create)(Code)(Java Doc) final protected String getSessionCookie(SessionManager manager)(Code)(Java Doc) public int getSessionGroup()(Code)(Java Doc) final protected SessionManager getSessionManager()(Code)(Java Doc) final public long getStartTime()(Code)(Java Doc) public ReadStream getStream() throws IOException(Code)(Java Doc) public ReadStream getStream(boolean isReader) throws IOException(Code)(Java Doc) abstract public byte[] getUriBuffer()(Code)(Java Doc) abstract public int getUriLength()(Code)(Java Doc) public Principal getUserPrincipal()(Code)(Java Doc) public String getVaryCookie()(Code)(Java Doc) public boolean getVaryCookies()(Code)(Java Doc) final public WebApp getWebApp()(Code)(Java Doc) public boolean handleResume() throws IOException(Code)(Java Doc) public void init()(Code)(Java Doc) abstract protected boolean initStream(ReadStream readStream, ReadStream rawStream) throws IOException(Code)(Java Doc) public boolean isIgnoreClientDisconnect()(Code)(Java Doc) protected boolean isKeepalive()(Code)(Java Doc) public boolean isRequestedSessionIdFromCookie()(Code)(Java Doc) public boolean isRequestedSessionIdFromURL()(Code)(Java Doc) public boolean isRequestedSessionIdFromUrl()(Code)(Java Doc) public boolean isRequestedSessionIdValid()(Code)(Java Doc) public boolean isSecure()(Code)(Java Doc) public boolean isTop()(Code)(Java Doc) public boolean isTransportSecure()(Code)(Java Doc) public boolean isUserInRole(String role)(Code)(Java Doc) public void killKeepalive()(Code)(Java Doc) public void logout()(Code)(Java Doc) public void logoutUserPrincipal()(Code)(Java Doc) public int printRemoteAddr(byte[] buffer, int offset) throws IOException(Code)(Java Doc) public void removeAttribute(String name)(Code)(Java Doc) protected void restartServer() throws IOException, ServletException(Code)(Java Doc) protected void resume() throws IOException(Code)(Java Doc) public String runAs(String role)(Code)(Java Doc) public void setAttribute(String name, Object value)(Code)(Java Doc) public void setCharacterEncoding(String encoding) throws UnsupportedEncodingException(Code)(Java Doc) public void setHasCookie()(Code)(Java Doc) public void setHeader(String key, String value)(Code)(Java Doc) final public void setInvocation(Invocation invocation)(Code)(Java Doc) final protected void setStartTime()(Code)(Java Doc) public void setVaryCookie(String cookie)(Code)(Java Doc) protected void skip() throws IOException(Code)(Java Doc) protected void start() throws IOException(Code)(Java Doc)
|
|
|
|