public class Http11Processor extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
protected String[] |
compressableMimeTypes
List of MIMES for which compression may be enabled.
|
protected int |
compressionLevel
Allowed compression level.
|
protected int |
compressionMinSize
Minimum content size to make compression.
|
protected int |
connectionUploadTimeout
Maximum timeout on uploads. 5 minutes as in Apache HTTPD server.
|
protected boolean |
contentDelimitation
Content delimiter for the request (if false, the connection will
be closed at the end of the request).
|
protected boolean |
disableUploadTimeout
Flag to disable setting a different time-out on uploads.
|
protected char[] |
hostNameC
Host name (used to avoid useless B2C conversion on the host name).
|
protected boolean |
http09
HTTP/0.9 flag.
|
protected boolean |
http11
HTTP/1.1 flag.
|
protected Http11InputBuffer |
inputBuffer
Input.
|
protected boolean |
keepAlive
Keep-alive.
|
protected int |
maxKeepAliveRequests
Maximum number of Keep-Alive requests to honor.
|
protected int |
maxSavePostSize
Max saved post size.
|
protected Pattern |
noCompressionUserAgents
Regular expression that defines the user agents to not use gzip with
|
protected boolean |
openSocket
Flag used to indicate that the socket should be kept open (e.g. for keep
alive or send file.
|
protected Http11OutputBuffer |
outputBuffer
Output.
|
protected boolean |
readComplete
Flag that indicates if the request headers have been completely read.
|
protected Pattern |
restrictedUserAgents
Regular expression that defines the restricted user agents.
|
protected SendfileDataBase |
sendfileData
Sendfile data.
|
protected UpgradeToken |
upgradeToken
Instance of the new protocol to use after the HTTP connection has been
upgraded.
|
adapter, asyncStateMachine, endpoint, request, response, socketWrapper, sslSupport
Constructor and Description |
---|
Http11Processor(int maxHttpHeaderSize,
AbstractEndpoint<?> endpoint,
int maxTrailerSize,
Set<String> allowedTrailerHeaders,
int maxExtensionSize,
int maxSwallowSize,
Map<String,UpgradeProtocol> httpUpgradeProtocols) |
Modifier and Type | Method and Description |
---|---|
void |
action(ActionCode actionCode,
Object param)
Send an action to the connector.
|
protected AbstractEndpoint.Handler.SocketState |
dispatchEndRequest()
Perform any necessary clean-up processing if the dispatch resulted in the
completion of processing for the current request.
|
protected boolean |
flushBufferedWrite()
Flush any pending writes.
|
String |
getCompression()
Return compression level.
|
int |
getConnectionUploadTimeout()
Get the upload timeout.
|
boolean |
getDisableUploadTimeout()
Get the flag that controls upload time-outs.
|
ByteBuffer |
getLeftoverInput()
Allows retrieving additional input during the upgrade process
|
protected Log |
getLog() |
int |
getMaxKeepAliveRequests()
Get the maximum number of Keep-Alive requests allowed.
|
int |
getMaxSavePostSize()
Return the maximum size of a POST which will be buffered in SSL mode.
|
UpgradeToken |
getUpgradeToken() |
boolean |
isUpgrade() |
void |
pause()
Informs the processor that the underlying I/O layer has stopped accepting
new connections.
|
void |
recycle()
Recycle the processor, ready for the next request which may be on the
same connection or a different connection.
|
AbstractEndpoint.Handler.SocketState |
service(SocketWrapperBase<?> socketWrapper)
Service a 'standard' HTTP request.
|
void |
setCompressableMimeTypes(String[] compressableMimeTypes)
Set compressible 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).
|
void |
setCompression(String compression)
Set compression level.
|
void |
setCompressionMinSize(int compressionMinSize)
Set Minimum size to trigger compression.
|
void |
setConnectionUploadTimeout(int timeout)
Set the upload timeout.
|
void |
setDisableUploadTimeout(boolean isDisabled)
Set the flag to control whether a separate connection timeout is used
during upload of a request body.
|
void |
setMaxKeepAliveRequests(int mkar)
Set the maximum number of Keep-Alive requests to allow.
|
void |
setMaxSavePostSize(int msps)
Set the maximum size of a POST which will be buffered in SSL mode.
|
void |
setNoCompressionUserAgents(String noCompressionUserAgents)
Set no compression user agent pattern.
|
void |
setRestrictedUserAgents(String restrictedUserAgents)
Set restricted user agent list (which will downgrade the connector
to HTTP/1.0 mode).
|
void |
setServer(String server)
Set the server header name.
|
void |
setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues) |
asyncPostProcess, dispatch, dispatchNonBlockingRead, getAdapter, getAsyncTimeout, getErrorState, getExecutor, getRequest, getSocketWrapper, isAsync, setAdapter, setAsyncTimeout, setErrorState, setSocketWrapper, setSslSupport, timeoutAsync
addDispatch, clearDispatches, getIteratorAndClearDispatches, process
protected final Http11InputBuffer inputBuffer
protected final Http11OutputBuffer outputBuffer
protected volatile boolean keepAlive
protected boolean openSocket
protected boolean readComplete
protected boolean http11
protected boolean http09
protected boolean contentDelimitation
protected Pattern restrictedUserAgents
protected int maxKeepAliveRequests
protected int connectionUploadTimeout
protected boolean disableUploadTimeout
protected int compressionLevel
protected int compressionMinSize
protected int maxSavePostSize
protected Pattern noCompressionUserAgents
protected String[] compressableMimeTypes
protected char[] hostNameC
protected UpgradeToken upgradeToken
protected SendfileDataBase sendfileData
public Http11Processor(int maxHttpHeaderSize, AbstractEndpoint<?> endpoint, int maxTrailerSize, Set<String> allowedTrailerHeaders, int maxExtensionSize, int maxSwallowSize, Map<String,UpgradeProtocol> httpUpgradeProtocols)
public void setCompression(String compression)
compression
- One of on
, force
,
off
or the minimum compression size in
bytes which implies on
public void setCompressionMinSize(int compressionMinSize)
compressionMinSize
- The minimum content length required for
compression in bytespublic void setNoCompressionUserAgents(String noCompressionUserAgents)
Pattern
. e.g.: gorilla|desesplorer|tigrus
.noCompressionUserAgents
- The regular expression for user agent
strings for which compression should not
be appliedpublic void setCompressableMimeTypes(String[] compressableMimeTypes)
compressableMimeTypes
- MIME types for which compression should be
enabledpublic String getCompression()
public void setRestrictedUserAgents(String restrictedUserAgents)
Pattern
.restrictedUserAgents
- The regular expression as supported by
Pattern
for the user agents e.g.
"gorilla|desesplorer|tigrus"public void setMaxKeepAliveRequests(int mkar)
mkar
- The new maximum number of Keep-Alive requests allowedpublic int getMaxKeepAliveRequests()
public void setMaxSavePostSize(int msps)
msps
- The maximum size POST body to buffer in bytespublic int getMaxSavePostSize()
public void setDisableUploadTimeout(boolean isDisabled)
isDisabled
- true
if the separate upload timeout should be
disabledpublic boolean getDisableUploadTimeout()
true
if the separate upload timeout is disabledpublic void setConnectionUploadTimeout(int timeout)
timeout
- Upload timeout in millisecondspublic int getConnectionUploadTimeout()
public void setServer(String server)
server
- The new value to use for the server headerpublic void setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues)
public final void action(ActionCode actionCode, Object param)
ActionHook
actionCode
- Type of the actionparam
- Action parameterpublic AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socketWrapper) throws IOException
AbstractProcessorLight
AbstractProcessorLight.dispatch(SocketEvent)
. Requests may be pipe-lined.service
in class AbstractProcessorLight
socketWrapper
- The connection to processIOException
- If an I/O error occurs during the processing of the
requestprotected boolean flushBufferedWrite() throws IOException
AbstractProcessor
flushBufferedWrite
in class AbstractProcessor
true
if data remains to be flushed at the end of
methodIOException
- If an I/O error occurs while attempting to flush the
dataprotected AbstractEndpoint.Handler.SocketState dispatchEndRequest()
AbstractProcessor
dispatchEndRequest
in class AbstractProcessor
public boolean isUpgrade()
public UpgradeToken getUpgradeToken()
protected Log getLog()
getLog
in class AbstractProcessorLight
public final void recycle()
Processor
recycle
in interface Processor
recycle
in class AbstractProcessor
public ByteBuffer getLeftoverInput()
Processor
public void pause()
Processor
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.