1 module Network.HTTP.Lucu.Chunk
2 ( chunkHeaderP -- Num a => Parser a
3 , chunkFooterP -- Parser ()
4 , chunkTrailerP -- Parser Headers
8 import Network.HTTP.Lucu.Headers
9 import Network.HTTP.Lucu.Parser
10 import Network.HTTP.Lucu.Parser.Http
14 chunkHeaderP :: Num a => Parser a
15 chunkHeaderP = do hexLen <- many1 hexDigit
19 let [(len, _)] = readHex hexLen
22 extension :: Parser ()
23 extension = do many $ do char ';'
28 {-# SPECIALIZE chunkHeaderP :: Parser Int #-}
31 chunkFooterP :: Parser ()
32 chunkFooterP = crlf >> return ()
35 chunkTrailerP :: Parser Headers
36 chunkTrailerP = headersP