Safe Haskell | None |
---|
- colon :: Word8
- space :: Word8
- nl :: Word8
- cr :: Word8
- data ParseError
- parseRequest :: (Proxy p, Monad m) => Bool -> SockAddr -> StateP ByteString p () ByteString a b m Request
- pipeBody :: (Proxy p, Monad m) => Request -> () -> StateP ByteString p () ByteString a ByteString m r
- parseRequestLine :: ByteString -> (Method, ByteString, HTTPVersion)
- parseMethod :: ByteString -> Method
- parseHTTPVersion :: ByteString -> HTTPVersion
- parseHeaders :: (Proxy p, Monad m) => StateP ByteString p () ByteString a b m [(ByteString, ByteString)]
- parseHeader :: ByteString -> (ByteString, ByteString)
- parseToken :: ByteString -> (ByteString, ByteString)
- takeLine :: (Proxy p, Monad m) => StateP ByteString p () ByteString a b m ByteString
Documentation
data ParseError Source
:: (Proxy p, Monad m) | |
=> Bool | is this an HTTPS connection? |
-> SockAddr | |
-> StateP ByteString p () ByteString a b m Request |
pipeBody :: (Proxy p, Monad m) => Request -> () -> StateP ByteString p () ByteString a ByteString m rSource
currently if you consume the entire request body this will
terminate and return the ret
value that you supplied. But, that
seems wrong, because that will tear down the whole pipeline and
return that value instead of what you really wanted to return.
Perhaps this should return a 'Maybe ByteString' instead so you can
detect when the body ends? But that interfers with using
parseRequest
in httpPipe
. For now we will just return empty
forever when you get to the end.
Perhaps pipes 2.5 will provide a better solution as it is supposed to allow you to catch termination of the upstream pipe.
parseHeaders :: (Proxy p, Monad m) => StateP ByteString p () ByteString a b m [(ByteString, ByteString)]Source
parseHeader :: ByteString -> (ByteString, ByteString)Source
parseToken :: ByteString -> (ByteString, ByteString)Source
takeLine :: (Proxy p, Monad m) => StateP ByteString p () ByteString a b m ByteStringSource
find a line terminated by a '\r\n'