Copyright | (C) Jonathan Lamothe |
---|---|
License | AGPL-3.0-or-later |
Maintainer | jonathan@jlamothe.net |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Important Note
This is an internal module. It is not intended to be accessed by outside packages, and should be considered subject to change at any time.
Synopsis
- runConnection :: Connection a -> GemHandler -> Maybe Certificate -> IO ()
- readURL :: Connection a -> IO (Maybe GemURL)
- strFromConn :: Int -> Connection a -> IO (Maybe String)
- readMax :: Int -> Connection a -> IO (Maybe ByteString)
- stripCRLF :: String -> Maybe String
Documentation
runConnection :: Connection a -> GemHandler -> Maybe Certificate -> IO () Source #
process a request and return a response over a Connection
:: Int | The maximum number of bytes to read |
-> Connection a | The connection to read from |
-> IO (Maybe String) |
Reads up to a maxumum number of bytes from a Connection
, UTF-8
decodes it, and returns the resulting string (if possible) without
the trailing CR/LF
:: Int | the maximum number of bytes |
-> Connection a | the |
-> IO (Maybe ByteString) |
Reads from a connection up to a maximum number of bytes or a
newline character is encountered, returning Nothing
if the limit
is exceeded