Top Description Fields Constructors Methods
io.undertow.server.protocol.http

pack-priv Class HttpTransferEncoding

extends Object
Class Inheritance
Imports
io.undertow.UndertowLogger, .UndertowOptions, io.undertow.conduits.ChunkedStreamSinkConduit, .ChunkedStreamSourceConduit, .ConduitListener, .FinishableStreamSinkConduit, .FixedLengthStreamSourceConduit, .HeadStreamSinkConduit, .PreChunkedStreamSinkConduit, io.undertow.server.Connectors, .HttpServerExchange, io.undertow.util.DateUtils, .HeaderMap, .Headers, .HttpString, .Methods, .StatusCodes, org.jboss.logging.Logger, org.xnio.conduits.ConduitStreamSourceChannel, .StreamSinkConduit, .StreamSourceConduit

Class that is responsible for HTTP transfer encoding, this could be part of the HttpReadListener, but is separated out for clarity.

For more info see http://tools.ietf.org/html/rfc2616#section-4.4

Authors
Stuart Douglas, David M. Lloyd

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private
HttpTransferEncoding()

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
private static ConduitListener<ChunkedStreamSourceConduit>
pack-priv static StreamSinkConduit
private static ConduitListener<FixedLengthStreamSourceConduit>
private static StreamSourceConduit
fixedLengthStreamSourceConduitWrapper(final long contentLength, final StreamSourceConduit conduit, final HttpServerExchange exchange)

private static StreamSinkConduit
handleExplicitTransferEncoding(HttpServerExchange exchange, StreamSinkConduit channel, ConduitListener<StreamSinkConduit> finishListener, HeaderMap responseHeaders, String transferEncodingHeader, boolean headRequest)

private static StreamSinkConduit
handleFixedLength(HttpServerExchange exchange, boolean headRequest, StreamSinkConduit channel, HeaderMap responseHeaders, String contentLengthHeader, HttpServerConnection connection)

private static boolean
handleRequestEncoding(final HttpServerExchange exchange, String transferEncodingHeader, String contentLengthHeader, HttpServerConnection connection, PipeliningBufferingStreamSinkConduit pipeliningBuffer, boolean persistentConnection)

private static StreamSinkConduit
handleResponseConduit(HttpServerExchange exchange, boolean headRequest, StreamSinkConduit channel, HeaderMap responseHeaders, ConduitListener<StreamSinkConduit> finishListener, String transferEncodingHeader)

public static long

Returns:

The long
parsePositiveLong
(String
The string
str
)

fast long parsing algorithm

private static boolean
persistentConnection(HttpServerExchange exchange, String connectionHeader)

public static void
private static ConduitListener<StreamSinkConduit>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log

Constructor Detail

HttpTransferEncodingback to summary
private HttpTransferEncoding()

Construct a new instance.

Method Detail

chunkedDrainListenerback to summary
private static ConduitListener<ChunkedStreamSourceConduit> chunkedDrainListener(final HttpServerExchange exchange)
createSinkConduitback to summary
pack-priv static StreamSinkConduit createSinkConduit(final HttpServerExchange exchange)
fixedLengthDrainListenerback to summary
private static ConduitListener<FixedLengthStreamSourceConduit> fixedLengthDrainListener(final HttpServerExchange exchange)
fixedLengthStreamSourceConduitWrapperback to summary
private static StreamSourceConduit fixedLengthStreamSourceConduitWrapper(final long contentLength, final StreamSourceConduit conduit, final HttpServerExchange exchange)
handleExplicitTransferEncodingback to summary
private static StreamSinkConduit handleExplicitTransferEncoding(HttpServerExchange exchange, StreamSinkConduit channel, ConduitListener<StreamSinkConduit> finishListener, HeaderMap responseHeaders, String transferEncodingHeader, boolean headRequest)
handleFixedLengthback to summary
private static StreamSinkConduit handleFixedLength(HttpServerExchange exchange, boolean headRequest, StreamSinkConduit channel, HeaderMap responseHeaders, String contentLengthHeader, HttpServerConnection connection)
handleRequestEncodingback to summary
private static boolean handleRequestEncoding(final HttpServerExchange exchange, String transferEncodingHeader, String contentLengthHeader, HttpServerConnection connection, PipeliningBufferingStreamSinkConduit pipeliningBuffer, boolean persistentConnection)
handleResponseConduitback to summary
private static StreamSinkConduit handleResponseConduit(HttpServerExchange exchange, boolean headRequest, StreamSinkConduit channel, HeaderMap responseHeaders, ConduitListener<StreamSinkConduit> finishListener, String transferEncodingHeader)
parsePositiveLongback to summary
public static long parsePositiveLong(String str)

fast long parsing algorithm

Parameters
str:String

The string

Returns:long

The long

persistentConnectionback to summary
private static boolean persistentConnection(HttpServerExchange exchange, String connectionHeader)
setupRequestback to summary
public static void setupRequest(final HttpServerExchange exchange)
terminateResponseListenerback to summary
private static ConduitListener<StreamSinkConduit> terminateResponseListener(final HttpServerExchange exchange)