Http11Processor (Apache Tomcat 7.0.96 API Documentation)

org.apache.coyote.http11

## Class Http11Processor

- java.lang.Object
- - org.apache.coyote.AbstractProcessor<S>
  - - org.apache.coyote.http11.AbstractHttp11Processor<java.net.Socket>
    - - org.apache.coyote.http11.Http11Processor

- All Implemented Interfaces:
    ActionHook, Processor<java.net.Socket>

      public class Http11Processor
      extends AbstractHttp11Processor<java.net.Socket>

  Processes HTTP requests.
  Author:
    Remy Maucherat, fhanik

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected InternalInputBuffer` | `inputBuffer` Input.
    `protected InternalOutputBuffer` | `outputBuffer` Output.
    `protected SSLSupport` | `sslSupport` SSL information.

    - ### Fields inherited from class org.apache.coyote.http11.AbstractHttp11Processor

      `comet, compressableMimeTypes, compressionLevel, compressionMinSize, connectionUploadTimeout, contentDelimitation, disableUploadTimeout, expectation, http09, http11, httpParser, httpUpgradeHandler, keepAlive, keepAliveTimeout, keptAlive, localAddr, localName, localPort, maxKeepAliveRequests, maxSavePostSize, noCompressionUserAgents, openSocket, readComplete, remoteAddr, remoteHost, remotePort, restrictedUserAgents, sendfileInProgress, server, sm, socketBuffer, upgradeInbound`

    - ### Fields inherited from class org.apache.coyote.AbstractProcessor

      `adapter, asyncStateMachine, endpoint, hostNameC, request, response, socketWrapper, userDataHelper`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Http11Processor(int headerBufferSize, boolean rejectIllegalHeaderName, JIoEndpoint endpoint, int maxTrailerSize, java.util.Set<java.lang.String> allowedTrailerHeaders, int maxExtensionSize, int maxSwallowSize, java.lang.String relaxedPathChars, java.lang.String relaxedQueryChars)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `actionInternal(ActionCode actionCode, java.lang.Object param)` Send an action to the connector.
    `protected boolean` | `breakKeepAliveLoop(SocketWrapper<java.net.Socket> socketWrapper)` Checks to see if the keep-alive loop should be broken, performing any processing (e.g. sendfile handling) that may have an impact on whether or not the keep-alive loop should be broken.
    `protected boolean` | `disableKeepAlive()` Processors (currently only HTTP BIO) may elect to disable HTTP keep-alive in some circumstances.
    `AbstractEndpoint.Handler.SocketState` | `event(SocketStatus status)` Process in-progress Comet requests.
    `int` | `getDisableKeepAlivePercentage()`
    `protected AbstractInputBuffer<java.net.Socket>` | `getInputBuffer()` Exposes input buffer to super class to allow better code re-use.
    `protected Log` | `getLog()`
    `protected AbstractOutputBuffer<java.net.Socket>` | `getOutputBuffer()` Exposes output buffer to super class to allow better code re-use.
    `protected boolean` | `handleIncompleteRequestLineRead()` Defines how a connector handles an incomplete request line read.
    `protected void` | `prepareRequestInternal()` Connector implementation specific request preparation.
    `protected boolean` | `prepareSendfile(OutputFilter[] outputFilters)`
    `protected void` | `recycleInternal()`
    `protected void` | `resetTimeouts()` Provides a mechanism for those connector implementations (currently only NIO) that need to reset timeouts from Async timeouts to standard HTTP timeouts once async processing completes.
    `protected void` | `setCometTimeouts(SocketWrapper<java.net.Socket> socketWrapper)` Provides a mechanism for those connectors (currently only NIO) that need that need to set comet timeouts.
    `void` | `setDisableKeepAlivePercentage(int disableKeepAlivePercentage)`
    `protected void` | `setRequestLineReadTimeout()` Configures the timeout to be used for reading the request line.
    `void` | `setSocketBuffer(int socketBuffer)` Set the socket buffer flag.
    `protected void` | `setSocketTimeout(int timeout)` Set the socket timeout.
    `void` | `setSslSupport(SSLSupport sslSupport)` Set the SSL information for this HTTP connection.

    - ### Methods inherited from class org.apache.coyote.http11.AbstractHttp11Processor

      `action, addCompressableMimeType, addCompressibleMimeType, asyncDispatch, endRequest, findBytes, getAllowHostHeaderMismatch, getCompression, getConnectionUploadTimeout, getDisableUploadTimeout, getHttpUpgradeHandler, getKeepAliveTimeout, getMaxKeepAliveRequests, getMaxSavePostSize, getServer, getSocketBuffer, getUpgradeInbound, initializeFilters, isComet, isUpgrade, populatePort, prepareRequest, process, recycle, setAllowHostHeaderMismatch, setCompressableMimeTypes, setCompressableMimeTypes, setCompressibleMimeTypes, setCompressibleMimeTypes, setCompression, setCompressionMinSize, setConnectionUploadTimeout, setDisableUploadTimeout, setKeepAliveTimeout, setMaxKeepAliveRequests, setMaxSavePostSize, setNoCompressionUserAgents, setRestrictedUserAgents, setServer, statusDropsConnection, upgradeDispatch, upgradeDispatch`

    - ### Methods inherited from class org.apache.coyote.AbstractProcessor

      `asyncPostProcess, errorDispatch, getAdapter, getAsyncStateMachine, getEndpoint, getErrorState, getExecutor, getMaxCookieCount, getRequest, getSocketWrapper, isAsync, parseHost, populateHost, resetErrorState, setAdapter, setErrorState, setMaxCookieCount, setSocketWrapper`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### inputBuffer

          protected InternalInputBuffer inputBuffer

      Input.

    - #### outputBuffer

          protected InternalOutputBuffer outputBuffer

      Output.

    - #### sslSupport

          protected SSLSupport sslSupport

      SSL information.

  - ### Constructor Detail

    - #### Http11Processor

          public Http11Processor(int headerBufferSize,
                         boolean rejectIllegalHeaderName,
                         JIoEndpoint endpoint,
                         int maxTrailerSize,
                         java.util.Set<java.lang.String> allowedTrailerHeaders,
                         int maxExtensionSize,
                         int maxSwallowSize,
                         java.lang.String relaxedPathChars,
                         java.lang.String relaxedQueryChars)

  - ### Method Detail

    - #### getLog

          protected Log getLog()

      Specified by:
        `getLog` in class `AbstractProcessor<java.net.Socket>`

    - #### setSslSupport

          public void setSslSupport(SSLSupport sslSupport)

      Set the SSL information for this HTTP connection.

    - #### getDisableKeepAlivePercentage

          public int getDisableKeepAlivePercentage()

    - #### setDisableKeepAlivePercentage

          public void setDisableKeepAlivePercentage(int disableKeepAlivePercentage)

    - #### disableKeepAlive

          protected boolean disableKeepAlive()

      Description copied from class: `AbstractHttp11Processor`
      Processors (currently only HTTP BIO) may elect to disable HTTP keep-alive in some circumstances. This method allows the processor implementation to determine if keep-alive should be disabled or not.
      Specified by:
        `disableKeepAlive` in class `AbstractHttp11Processor<java.net.Socket>`

    - #### setRequestLineReadTimeout

          protected void setRequestLineReadTimeout()
                                            throws java.io.IOException

      Description copied from class: `AbstractHttp11Processor`
      Configures the timeout to be used for reading the request line.
      Specified by:
        `setRequestLineReadTimeout` in class `AbstractHttp11Processor<java.net.Socket>`
      Throws:
        `java.io.IOException`

    - #### handleIncompleteRequestLineRead

          protected boolean handleIncompleteRequestLineRead()

      Description copied from class: `AbstractHttp11Processor`
      Defines how a connector handles an incomplete request line read.
      Specified by:
        `handleIncompleteRequestLineRead` in class `AbstractHttp11Processor<java.net.Socket>`
      Returns:
        `true` if the processor should break out of the processing loop, otherwise `false`.

    - #### setSocketTimeout

          protected void setSocketTimeout(int timeout)
                                   throws java.io.IOException

      Description copied from class: `AbstractHttp11Processor`
      Set the socket timeout.
      Specified by:
        `setSocketTimeout` in class `AbstractHttp11Processor<java.net.Socket>`
      Throws:
        `java.io.IOException`

    - #### setCometTimeouts

          protected void setCometTimeouts(SocketWrapper<java.net.Socket> socketWrapper)

      Description copied from class: `AbstractHttp11Processor`
      Provides a mechanism for those connectors (currently only NIO) that need that need to set comet timeouts.
      Specified by:
        `setCometTimeouts` in class `AbstractHttp11Processor<java.net.Socket>`

    - #### breakKeepAliveLoop

          protected boolean breakKeepAliveLoop(SocketWrapper<java.net.Socket> socketWrapper)

      Description copied from class: `AbstractHttp11Processor`
      Checks to see if the keep-alive loop should be broken, performing any processing (e.g. sendfile handling) that may have an impact on whether or not the keep-alive loop should be broken.
      Specified by:
        `breakKeepAliveLoop` in class `AbstractHttp11Processor<java.net.Socket>`
      Returns:
        true if the keep-alive loop should be broken

    - #### resetTimeouts

          protected void resetTimeouts()

      Description copied from class: `AbstractHttp11Processor`
      Provides a mechanism for those connector implementations (currently only NIO) that need to reset timeouts from Async timeouts to standard HTTP timeouts once async processing completes.
      Specified by:
        `resetTimeouts` in class `AbstractHttp11Processor<java.net.Socket>`

    - #### recycleInternal

          protected void recycleInternal()

      Specified by:
        `recycleInternal` in class `AbstractHttp11Processor<java.net.Socket>`

    - #### event

          public AbstractEndpoint.Handler.SocketState event(SocketStatus status)
                                                     throws java.io.IOException

      Description copied from class: `AbstractProcessor`
      Process in-progress Comet requests. These will start as HTTP requests.
      Specified by:
        `event` in interface `Processor<java.net.Socket>`
      Specified by:
        `event` in class `AbstractProcessor<java.net.Socket>`
      Throws:
        `java.io.IOException`

    - #### actionInternal

          public void actionInternal(ActionCode actionCode,
                            java.lang.Object param)

      Send an action to the connector.
      Specified by:
        `actionInternal` in class `AbstractHttp11Processor<java.net.Socket>`
      Parameters:
        `actionCode` - Type of the action
        `param` - Action parameter

    - #### prepareRequestInternal

          protected void prepareRequestInternal()

      Description copied from class: `AbstractHttp11Processor`
      Connector implementation specific request preparation. Ideally, this will go away in the future.
      Specified by:
        `prepareRequestInternal` in class `AbstractHttp11Processor<java.net.Socket>`

    - #### prepareSendfile

          protected boolean prepareSendfile(OutputFilter[] outputFilters)

      Specified by:
        `prepareSendfile` in class `AbstractHttp11Processor<java.net.Socket>`

    - #### getInputBuffer

          protected AbstractInputBuffer<java.net.Socket> getInputBuffer()

      Description copied from class: `AbstractHttp11Processor`
      Exposes input buffer to super class to allow better code re-use.
      Specified by:
        `getInputBuffer` in class `AbstractHttp11Processor<java.net.Socket>`
      Returns:
        The input buffer used by the processor.

    - #### getOutputBuffer

          protected AbstractOutputBuffer<java.net.Socket> getOutputBuffer()

      Description copied from class: `AbstractHttp11Processor`
      Exposes output buffer to super class to allow better code re-use.
      Specified by:
        `getOutputBuffer` in class `AbstractHttp11Processor<java.net.Socket>`
      Returns:
        The output buffer used by the processor.

    - #### setSocketBuffer

          public void setSocketBuffer(int socketBuffer)

      Set the socket buffer flag.
      Overrides:
        `setSocketBuffer` in class `AbstractHttp11Processor<java.net.Socket>`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.