Safe Haskell | None |
---|
- type Limit = Int
- readMessageHeader :: Limit -> Connection -> IO (ByteString, [Header])
- defaultHeaderSizeLimit :: Limit
- parseHeaderFields :: [ByteString] -> Maybe [Header]
- sendHeader :: (ByteString -> IO ()) -> ByteString -> [Header] -> IO ()
- readHeaderLines :: Limit -> Connection -> IO [ByteString]
- combineHeaderLines :: [ByteString] -> [ByteString]
Documentation
readMessageHeader :: Limit -> Connection -> IO (ByteString, [Header])Source
Read start-line and message headers from provided Connection
(see RFC 2616, Section 4.1).
Throws:
-
HeaderTooLarge
if start-line and headers together exceed the specified sizeLimit
-
InvalidHeader
if start-line is missing or a header is malformed
defaultHeaderSizeLimit :: LimitSource
The default message header size limit of 65536 bytes (64 KB).
parseHeaderFields :: [ByteString] -> Maybe [Header]Source
Parse header fields according to RFC 2616, Section 4.2.
sendHeader :: (ByteString -> IO ()) -> ByteString -> [Header] -> IO ()Source
Send given start-line and message headers.
Note: The first argument to this function is used to send the data. For space efficiency it may be called multiple times.
Internals
readHeaderLines :: Limit -> Connection -> IO [ByteString]Source
combineHeaderLines :: [ByteString] -> [ByteString]Source