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 = many ( char ';' >>
26 ( token <|> quotedStr )
30 {-# SPECIALIZE chunkHeaderP :: Parser Int #-}
33 chunkFooterP :: Parser ()
34 chunkFooterP = crlf >> return ()
37 chunkTrailerP :: Parser Headers
38 chunkTrailerP = headersP