on master help sign in
doc update.
commit84e80b543414df0f39b1d821792415600d6b8a83 authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 19 Jun 2015, 09:36 (11 years ago) parentc8ba115
5 files changed+16−2
warp/Network/Wai/Handler/Warp.hs+1−1 warp/Network/Wai/Handler/Warp/SendFile.hs+4 warp/Network/Wai/Handler/Warp/Settings.hs+6 warp/Network/Wai/Handler/Warp/Timeout.hs+1−1 warp/Network/Wai/Handler/Warp/Types.hs+4
warp/Network/Wai/Handler/Warp.hs+1−1
@@ -90,7 +90,7 @@ module Network.Wai.Handler.Warp (
9090 -- * Per-request utilities
9191 , pauseTimeout
9292 -- * Internal
93− -- | The following APIs will be removed. They are also exported in Network.Wai.Handler.Warp.Internal. Please use the Internal module instead.
93+ -- | The following APIs will be removed in Warp 3.2.0. Please use ones exported from Network.Wai.Handler.Warp.Internal.
9494
9595 -- ** Low level run functions
9696 , runSettingsConnection
warp/Network/Wai/Handler/Warp/SendFile.hs+4
@@ -35,6 +35,8 @@ import System.Posix.Types
3535-- | Function to send a file based on sendfiel() for Linux\/Mac\/FreeBSD.
3636-- This makes use of the file descriptor cache.
3737-- For other OSes, this is identical to 'readSendFile'.
38+--
39+-- Since: 3.1.0
3840sendFile :: Socket -> Buffer -> BufSize -> (ByteString -> IO ()) -> SendFile
3941#ifdef SENDFILEFD
4042sendFile s _ _ _ fid off len act hdr = case mfid of
@@ -80,6 +82,8 @@ mini i n
8082-- | Function to send a file based on pread()\/send() for Unix.
8183-- This makes use of the file descriptor cache.
8284-- For Windows, this is emulated by 'Handle'.
85+--
86+-- Since: 3.1.0
8387#ifdef WINDOWS
8488readSendFile :: Buffer -> BufSize -> (ByteString -> IO ()) -> SendFile
8589readSendFile buf siz send fid off0 len0 hook headers = do
warp/Network/Wai/Handler/Warp/Settings.hs+6
@@ -134,12 +134,16 @@ defaultShouldDisplayException se
134134
135135-- | Printing an exception to standard error
136136-- if `defaultShouldDisplayException` returns `True`.
137+--
138+-- Since: 3.1.0
137139defaultOnException :: Maybe Request -> SomeException -> IO ()
138140defaultOnException _ e =
139141 when (defaultShouldDisplayException e)
140142 $ TIO.hPutStrLn stderr $ T.pack $ show e
141143
142144-- | Sending 400 for bad requests. Sending 500 for internal server errors.
145+--
146+-- Since: 3.1.0
143147defaultOnExceptionResponse :: SomeException -> Response
144148defaultOnExceptionResponse e
145149 | Just (_ :: InvalidRequest) <- fromException e = responseLBS H.badRequest400 [(H.hContentType, "text/plain; charset=utf-8")] "Bad Request"
@@ -147,6 +151,8 @@ defaultOnExceptionResponse e
147151
148152-- | Exception handler for the debugging purpose.
149153-- 500, text/plain, a showed exception.
154+--
155+-- Since: 2.0.3.2
150156exceptionResponseForDebug :: SomeException -> Response
151157exceptionResponseForDebug e = responseLBS H.internalServerError500 [(H.hContentType, "text/plain; charset=utf-8")] (TLE.encodeUtf8 $ TL.pack $ "Exception: " ++ show e)
152158
warp/Network/Wai/Handler/Warp/Timeout.hs+1−1
@@ -5,7 +5,7 @@
55
66-- |
77--
8−-- Note that this module will not be exported in the near future.
8+-- Note that this module will not be exported in Warp 3.2.0.
99-- Please use Network.Wai.Handler.Warp.Internal instead.
1010--
1111-- In order to provide slowloris protection, Warp provides timeout handlers. We
warp/Network/Wai/Handler/Warp/Types.hs+4
@@ -74,12 +74,16 @@ type Fd = ()
7474-- | Data type to abstract file identifiers.
7575-- On Unix, a file descriptor would be specified to make use of
7676-- the file descriptor cache.
77+--
78+-- Since: 3.1.0
7779data FileId = FileId {
7880 fileIdPath :: FilePath
7981 , fileIdFd :: Maybe Fd
8082 }
8183
8284-- | fileid, offset, length, hook action, HTTP headers
85+--
86+-- Since: 3.1.0
8387type SendFile = FileId -> Integer -> Integer -> IO () -> [ByteString] -> IO ()
8488
8589-- | Type for read buffer pool