Save This Page
Home » apache-tomcat-6.0.26-src » org.apache » coyote » http11 » [javadoc | source]
org.apache.coyote.http11
public class: Http11Processor [javadoc | source]
java.lang.Object
   org.apache.coyote.http11.Http11Processor

All Implemented Interfaces:
    ActionHook

Processes HTTP requests.
Field Summary
protected static  Log log    Logger. 
protected static  StringManager sm    The string manager for this package. 
protected static  boolean isSecurityEnabled     
protected  Adapter adapter    Associated adapter. 
protected  Request request    Request object. 
protected  Response response    Response object. 
protected  InternalInputBuffer inputBuffer    Input. 
protected  InternalOutputBuffer outputBuffer    Output. 
protected  boolean started    State flag. 
protected  boolean error    Error flag. 
protected  boolean keepAlive    Keep-alive. 
protected  boolean http11    HTTP/1.1 flag. 
protected  boolean http09    HTTP/0.9 flag. 
protected  boolean contentDelimitation    Content delimitator for the request (if false, the connection will be closed at the end of the request). 
protected  boolean expectation    Is there an expectation ? 
protected  Pattern[] restrictedUserAgents    List of restricted user agents. 
protected  int maxKeepAliveRequests    Maximum number of Keep-Alive requests to honor. 
protected  int keepAliveTimeout    The number of seconds Tomcat will wait for a subsequent request before closing the connection. 
protected  SSLSupport sslSupport    SSL information. 
protected  Socket socket    Socket associated with the current connection. 
protected  String remoteAddr    Remote Address associated with the current connection. 
protected  String remoteHost    Remote Host associated with the current connection. 
protected  String localName    Local Host associated with the current connection. 
protected  int localPort    Local port to which the socket is connected 
protected  int remotePort    Remote port to which the socket is connected 
protected  String localAddr    The local Host address. 
protected  int timeout    Maximum timeout on uploads. 5 minutes as in Apache HTTPD server. 
protected  boolean disableUploadTimeout    Flag to disable setting a different time-out on uploads. 
protected  int compressionLevel    Allowed compression level. 
protected  int compressionMinSize    Minimum contentsize to make compression. 
protected  int socketBuffer    Socket buffering. 
protected  int maxSavePostSize    Max saved post size. 
protected  Pattern[] noCompressionUserAgents    List of user agents to not use gzip with 
protected  String[] compressableMimeTypes    List of MIMES which could be gzipped 
protected  char[] hostNameC    Host name (used to avoid useless B2C conversion on the host name). 
protected  JIoEndpoint endpoint    Associated endpoint. 
protected  String server    Allow a customized the server header for the tin-foil hat folks. 
Constructor:
 public Http11Processor(int headerBufferSize,
    JIoEndpoint endpoint) 
Method from org.apache.coyote.http11.Http11Processor Summary:
action,   addCompressableMimeType,   addFilter,   addInputFilter,   addNoCompressionUserAgent,   addRestrictedUserAgent,   findBytes,   findCompressableMimeTypes,   findRestrictedUserAgents,   getAdapter,   getCompression,   getDisableUploadTimeout,   getKeepAliveTimeout,   getMaxKeepAliveRequests,   getMaxSavePostSize,   getRequest,   getServer,   getSocketBuffer,   getTimeout,   initializeFilters,   parseHost,   prepareRequest,   prepareResponse,   process,   setAdapter,   setCompressableMimeTypes,   setCompressableMimeTypes,   setCompression,   setCompressionMinSize,   setDisableUploadTimeout,   setKeepAliveTimeout,   setMaxKeepAliveRequests,   setMaxSavePostSize,   setNoCompressionUserAgents,   setNoCompressionUserAgents,   setRestrictedUserAgents,   setRestrictedUserAgents,   setSSLSupport,   setServer,   setSocketBuffer,   setTimeout,   statusDropsConnection
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.coyote.http11.Http11Processor Detail:
 public  void action(ActionCode actionCode,
    Object param) 
    Send an action to the connector.
 public  void addCompressableMimeType(String mimeType) 
    Add a mime-type which will be compressable The mime-type String will be exactly matched in the response mime-type header .
 protected  void addFilter(String className) 
    Add input or output filter.
 protected boolean addInputFilter(InputFilter[] inputFilters,
    String encodingName) 
    Add an input filter to the current request.
 public  void addNoCompressionUserAgent(String userAgent) 
    Add user-agent for which gzip compression didn't works The user agent String given will be exactly matched to the user-agent header submitted by the client.
 public  void addRestrictedUserAgent(String userAgent) 
    Add restricted user-agent (which will downgrade the connector to HTTP/1.0 mode). The user agent String given will be matched via regexp to the user-agent header submitted by the client.
 protected int findBytes(ByteChunk bc,
    byte[] b) 
    Specialized utility method: find a sequence of lower case bytes inside a ByteChunk.
 public String[] findCompressableMimeTypes() 
    Return the list of restricted user agents.
 public String[] findRestrictedUserAgents() 
    Return the list of restricted user agents.
 public Adapter getAdapter() 
    Get the associated adapter.
 public String getCompression() 
    Return compression level.
 public boolean getDisableUploadTimeout() 
    Get the flag that controls upload time-outs.
 public int getKeepAliveTimeout() 
    Return the number Keep-Alive timeout.
 public int getMaxKeepAliveRequests() 
    Return the number of Keep-Alive requests that we will honor.
 public int getMaxSavePostSize() 
    Return the maximum size of a POST which will be buffered in SSL mode.
 public Request getRequest() 
    Get the request associated with this processor.
 public String getServer() 
    Get the server header name.
 public int getSocketBuffer() 
    Get the socket buffer flag.
 public int getTimeout() 
    Get the upload timeout.
 protected  void initializeFilters() 
    Initialize standard input and output filters.
 public  void parseHost(MessageBytes valueMB) 
    Parse host.
 protected  void prepareRequest() 
    After reading the request headers, we have to setup the request filters.
 protected  void prepareResponse() 
    When committing the response, we have to validate the set of headers, as well as setup the response filters.
 public  void process(Socket theSocket) throws IOException 
    Process pipelined HTTP requests on the specified socket.
 public  void setAdapter(Adapter adapter) 
    Set the associated adapter.
 public  void setCompressableMimeTypes(String[] compressableMimeTypes) 
    Set compressable mime-type list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 public  void setCompressableMimeTypes(String compressableMimeTypes) 
    Set compressable mime-type list List contains users agents separated by ',' : ie: "text/html,text/xml,text/plain"
 public  void setCompression(String compression) 
    Set compression level.
 public  void setCompressionMinSize(int compressionMinSize) 
    Set Minimum size to trigger compression.
 public  void setDisableUploadTimeout(boolean isDisabled) 
    Set the flag to control upload time-outs.
 public  void setKeepAliveTimeout(int timeout) 
    Set the Keep-Alive timeout.
 public  void setMaxKeepAliveRequests(int mkar) 
    Set the maximum number of Keep-Alive requests to honor. This is to safeguard from DoS attacks. Setting to a negative value disables the check.
 public  void setMaxSavePostSize(int msps) 
    Set the maximum size of a POST which will be buffered in SSL mode.
 public  void setNoCompressionUserAgents(Pattern[] noCompressionUserAgents) 
    Set no compression user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 public  void setNoCompressionUserAgents(String noCompressionUserAgents) 
    Set no compression user agent list. List contains users agents separated by ',' : ie: "gorilla,desesplorer,tigrus"
 public  void setRestrictedUserAgents(Pattern[] restrictedUserAgents) 
    Set restricted user agent list (this method is best when used with a large number of connectors, where it would be better to have all of them referenced a single array).
 public  void setRestrictedUserAgents(String restrictedUserAgents) 
    Set restricted user agent list (which will downgrade the connector to HTTP/1.0 mode). List contains users agents separated by ',' : ie: "gorilla,desesplorer,tigrus"
 public  void setSSLSupport(SSLSupport sslSupport) 
    Set the SSL information for this HTTP connection.
 public  void setServer(String server) 
    Set the server header name.
 public  void setSocketBuffer(int socketBuffer) 
    Set the socket buffer flag.
 public  void setTimeout(int timeouts) 
    Set the upload timeout.
 protected boolean statusDropsConnection(int status) 
    Determine if we must drop the connection because of the HTTP status code. Use the same list of codes as Apache/httpd.