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

pack-priv final Class HttpReadListener

extends Object
implements ChannelListener<ConduitStreamSourceChannel>, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, org.xnio.ChannelListener, java.util.EventListener
Imports
io.undertow.UndertowLogger, .UndertowMessages, .UndertowOptions, io.undertow.conduits.ReadDataStreamSourceConduit, io.undertow.connector.PooledByteBuffer, io.undertow.protocols.http2.Http2Channel, io.undertow.server.ConnectorStatisticsImpl, .Connectors, .HttpServerExchange, io.undertow.server.protocol.ParseTimeoutUpdater, io.undertow.server.protocol.http2.Http2ReceiveListener, io.undertow.util.ClosingChannelExceptionHandler, .ConnectionUtils, .HeaderValues, .Headers, .HttpString, .Methods, .Protocols, .StringWriteChannelListener, org.xnio.ChannelListener, .ChannelListeners, .IoUtils, .StreamConnection, org.xnio.channels.StreamSinkChannel, .StreamSourceChannel, org.xnio.conduits.ConduitStreamSinkChannel, .ConduitStreamSourceChannel, java.io.IOException, java.nio.ByteBuffer, java.util.concurrent.Executor, java.util.concurrent.atomic.AtomicIntegerFieldUpdater

Listener which reads requests and headers off of an HTTP stream.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private final boolean
private static final String
private final HttpServerConnection
private final ConnectorStatisticsImpl
private HttpServerExchange
private final long
private final int
private final HttpRequestParser
private ParseTimeoutUpdater
private static final HttpString
PRI

used for HTTP2 prior knowledge support

private static final byte[]
private int
private final boolean
private volatile int
private static final AtomicIntegerFieldUpdater<HttpReadListener>
private final boolean
private final ParseState

Constructor Summary

AccessConstructor and Description
pack-priv
HttpReadListener(final HttpServerConnection connection, final HttpRequestParser parser, ConnectorStatisticsImpl connectorStatistics)

Method Summary

Modifier and TypeMethod and Description
private boolean
doHttp2PriRead(StreamConnection connection, ByteBuffer buffer, HttpServerConnection serverConnection, PooledByteBuffer extraData)

public void
public void
handleEvent(final ConduitStreamSourceChannel
the channel event
channel
)

Implements org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

public void
private void
private boolean
private void
handleHttp2PriorKnowledge(final StreamConnection connection, final HttpServerConnection serverConnection, PooledByteBuffer readData)

private boolean
public void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

private void
sendBadRequestAndClose(final StreamConnection connection, final Throwable exception)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowUnknownProtocolsback to summary
private final boolean allowUnknownProtocols
BAD_REQUESTback to summary
private static final String BAD_REQUEST
connectionback to summary
private final HttpServerConnection connection
connectorStatisticsback to summary
private final ConnectorStatisticsImpl connectorStatistics
httpServerExchangeback to summary
private HttpServerExchange httpServerExchange
maxEntitySizeback to summary
private final long maxEntitySize
maxRequestSizeback to summary
private final int maxRequestSize
parserback to summary
private final HttpRequestParser parser
parseTimeoutUpdaterback to summary
private ParseTimeoutUpdater parseTimeoutUpdater
PRIback to summary
private static final HttpString PRI

used for HTTP2 prior knowledge support

PRI_EXPECTEDback to summary
private static final byte[] PRI_EXPECTED
readback to summary
private int read
recordRequestStartTimeback to summary
private final boolean recordRequestStartTime
requestStateback to summary
private volatile int requestState
Annotations
@SuppressWarnings:unused
requestStateUpdaterback to summary
private static final AtomicIntegerFieldUpdater<HttpReadListener> requestStateUpdater
requireHostHeaderback to summary
private final boolean requireHostHeader
stateback to summary
private final ParseState state

Constructor Detail

HttpReadListenerback to summary
pack-priv HttpReadListener(final HttpServerConnection connection, final HttpRequestParser parser, ConnectorStatisticsImpl connectorStatistics)

Method Detail

doHttp2PriReadback to summary
private boolean doHttp2PriRead(StreamConnection connection, ByteBuffer buffer, HttpServerConnection serverConnection, PooledByteBuffer extraData) throws IOException
exchangeCompleteback to summary
public void exchangeComplete(final HttpServerExchange exchange)
handleEventback to summary
public void handleEvent(final ConduitStreamSourceChannel channel)

Implements org.xnio.ChannelListener.handleEvent.

Doc from org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

Parameters
channel:ConduitStreamSourceChannel

the channel event

handleEventWithNoRunningRequestback to summary
public void handleEventWithNoRunningRequest(final ConduitStreamSourceChannel channel)
handleFailedReadback to summary
private void handleFailedRead(ConduitStreamSourceChannel channel, int res)
handleHttp2PriorKnowledgeback to summary
private boolean handleHttp2PriorKnowledge(PooledByteBuffer pooled, HttpServerExchange httpServerExchange) throws IOException
handleHttp2PriorKnowledgeback to summary
private void handleHttp2PriorKnowledge(final StreamConnection connection, final HttpServerConnection serverConnection, PooledByteBuffer readData) throws IOException
isUpgradeOrConnectback to summary
private boolean isUpgradeOrConnect(HttpServerExchange exchange)
newRequestback to summary
public void newRequest()
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
sendBadRequestAndCloseback to summary
private void sendBadRequestAndClose(final StreamConnection connection, final Throwable exception)