{-# OPTIONS_GHC -fno-warn-deprecations #-} -- | -- __IMPORTANT NOTICE__ -- -- This module exports internals mainly to provide the @warp-tls@ package -- with tools to implement what it needs to. This module\/API should /NOT/ be -- expected to remain stable at all, even between minor releases. -- -- If you see a use case for these functions or types for other purposes, -- please create an issue in the repository so that we might add it to the -- main 'Network.Wai.Handler.Warp' API. module Network.Wai.Handler.Warp.Internal ( -- * Settings Settings (..), ProxyProtocol (..), makeSettingsAndCounter, makeSettingsAndServerState, -- ** Connection counter Counter, getCount, -- ** Server state ServerState, makeServerState, -- * Low level run functions runSettingsConnection, runSettingsConnectionMaker, runSettingsConnectionMakerSecure, runSettingsConnectionMakerSecureWith, Transport (..), -- ** Stopping the accept loop Listener (..), noListener, makeListener, AcceptStopped (..), -- * Connection Connection (..), socketConnection, -- ** Receive Recv, makeGracefulRecv, RecvBuf, -- ** Buffer Buffer, BufSize, WriteBuffer (..), createWriteBuffer, allocateBuffer, freeBuffer, copy, -- ** Sendfile FileId (..), SendFile, sendFile, readSendFile, -- * Version warpVersion, -- * Data types -- | -- -- The internals of 'IndexedHeader' have changed since @3.4.15@, so we -- keep exporting it as a type synonym, but it is now a record instead of -- an array. -- As such there's no more 'requestMaxIndex', but we provide a blank -- 'defaultIndexRequestHeader'. InternalInfo (..), HeaderValue, IndexedHeader, -- I assume 'requestMaxIndex' was used in case anyone wanted to create -- an empty array, so we replace it with 'defaultIndexRequestHeader'. defaultIndexRequestHeader, -- * Time out manager -- | -- -- In order to provide slowloris protection, Warp provides timeout handlers. We -- follow these rules: -- -- * A timeout is created when a connection is opened. -- -- * When all request headers are read, the timeout is tickled. -- -- * Every time at least the slowloris size settings number of bytes of the request -- body are read, the timeout is tickled. -- -- * The timeout is paused while executing user code. This will apply to both -- the application itself, and a ResponseSource response. The timeout is -- resumed as soon as we return from user code. -- -- * Every time data is successfully sent to the client, the timeout is tickled. module System.TimeManager, -- * File descriptor cache module Network.Wai.Handler.Warp.FdCache, -- * File information cache module Network.Wai.Handler.Warp.FileInfoCache, -- * Date module Network.Wai.Handler.Warp.Date, -- * Request and response Source, FirstRequest (..), recvRequest, sendResponse, -- * Platform dependent helper functions setSocketCloseOnExec, windowsThreadBlockHack, -- * Misc http2server, withII, serveConnection, pReadMaker, ) where import Network.Socket.BufferPool import System.TimeManager import Network.Wai.Handler.Warp.Buffer import Network.Wai.Handler.Warp.Counter (Counter, getCount) import Network.Wai.Handler.Warp.Date import Network.Wai.Handler.Warp.FdCache import Network.Wai.Handler.Warp.FileInfoCache import Network.Wai.Handler.Warp.HTTP2 import Network.Wai.Handler.Warp.HTTP2.File import Network.Wai.Handler.Warp.Header import Network.Wai.Handler.Warp.Request import Network.Wai.Handler.Warp.Response import Network.Wai.Handler.Warp.Run import Network.Wai.Handler.Warp.SendFile import Network.Wai.Handler.Warp.Settings import Network.Wai.Handler.Warp.Types import Network.Wai.Handler.Warp.Windows type IndexedHeader = IndexedRequestHeader