@@ -38,6 +38,7 @@ hServer = "Server"
3838
3939----------------------------------------------------------------
4040
41+-- | Error types for bad 'Request'.
4142data InvalidRequest =
4243 NotEnoughLines [String]
4344 | BadFirstLine String
@@ -51,27 +52,11 @@ instance Exception InvalidRequest
5152
5253----------------------------------------------------------------
5354
54−-- |
55−--
56−-- In order to provide slowloris protection, Warp provides timeout handlers. We
57−-- follow these rules:
58−--
59−-- * A timeout is created when a connection is opened.
60−--
61−-- * When all request headers are read, the timeout is tickled.
62−--
63−-- * Every time at least 2048 bytes of the request body are read, the timeout
64−-- is tickled.
65−--
66−-- * The timeout is paused while executing user code. This will apply to both
67−-- the application itself, and a ResponseSource response. The timeout is
68−-- resumed as soon as we return from user code.
69−--
70−-- * Every time data is successfully sent to the client, the timeout is tickled.
55+-- | Data type to manipulate IO actions for connections.
7156data Connection = Connection
7257 { connSendMany :: [ByteString] -> IO ()
7358 , connSendAll :: ByteString -> IO ()
74− , connSendFile :: FilePath -> Integer -> Integer -> IO () -> [ByteString] -> Cleaner -> IO () -- ^ offset, length
59+ , connSendFile :: FilePath -> Integer -> Integer -> IO () -> [ByteString] -> Cleaner -> IO () -- ^ filepath, offset, length, hook action, HTTP headers, fd clear
7560 , connClose :: IO ()
7661 , connRecv :: IO ByteString
7762 }