X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FChunk.hs;h=c2135ef1105ae96e85f0f39db1a32240b7ee5929;hp=b48727cc0f364fdbe3037cd759cbbf01476216a4;hb=90fca0675b1694e69b8e431c989343855cbd125d;hpb=ece223c516e66223ef1d5d8e6bbe4054a235d983 diff --git a/Network/HTTP/Lucu/Chunk.hs b/Network/HTTP/Lucu/Chunk.hs index b48727c..c2135ef 100644 --- a/Network/HTTP/Lucu/Chunk.hs +++ b/Network/HTTP/Lucu/Chunk.hs @@ -2,23 +2,24 @@ UnicodeSyntax #-} module Network.HTTP.Lucu.Chunk - ( chunkHeaderP - , chunkFooterP - , chunkTrailerP + ( chunkHeader + , chunkFooter + , chunkTrailer ) where import Control.Applicative import Data.Attoparsec.Char8 import Data.Bits +import Data.Default import Network.HTTP.Lucu.Headers import Network.HTTP.Lucu.Parser.Http -chunkHeaderP ∷ (Integral a, Bits a) ⇒ Parser a -{-# INLINEABLE chunkHeaderP #-} -chunkHeaderP = do len ← hexadecimal - extension - crlf - return len +chunkHeader ∷ (Integral a, Bits a) ⇒ Parser a +{-# INLINEABLE chunkHeader #-} +chunkHeader = do len ← hexadecimal + extension + crlf + return len where extension ∷ Parser () extension @@ -27,8 +28,10 @@ chunkHeaderP = do len ← hexadecimal char '=' *> (token <|> quotedStr) ) -chunkFooterP ∷ Parser () -chunkFooterP = crlf +chunkFooter ∷ Parser () +{-# INLINE chunkFooter #-} +chunkFooter = crlf -chunkTrailerP ∷ Parser Headers -chunkTrailerP = headersP +chunkTrailer ∷ Parser Headers +{-# INLINE chunkTrailer #-} +chunkTrailer = def