on master help sign in
exporting all getters from the top module.
commit8031d070ae09f214f91978aa113577f7e2c7ef07 authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 19 Jun 2015, 09:57 (11 years ago) parent7ba387e
2 files changed+15−13
warp/Network/Wai/Handler/Warp.hs+15 warp/Network/Wai/Handler/Warp/Internal.hs−13
warp/Network/Wai/Handler/Warp.hs+15
@@ -64,6 +64,9 @@ module Network.Wai.Handler.Warp (
6464 -- ** Getters
6565 , getPort
6666 , getHost
67+ , getOnOpen
68+ , getOnClose
69+ , getOnException
6770 -- ** Exception handler
6871 , defaultOnException
6972 , defaultShouldDisplayException
@@ -236,6 +239,18 @@ getPort = settingsPort
236239getHost :: Settings -> HostPreference
237240getHost = settingsHost
238241
242+-- | Get the action on opening connection.
243+getOnOpen :: Settings -> SockAddr -> IO Bool
244+getOnOpen = settingsOnOpen
245+
246+-- | Get the action on closeing connection.
247+getOnClose :: Settings -> SockAddr -> IO ()
248+getOnClose = settingsOnClose
249+
250+-- | Get the exception handler.
251+getOnException :: Settings -> Maybe Request -> SomeException -> IO ()
252+getOnException = settingsOnException
253+
239254-- | A code to install shutdown handler.
240255--
241256-- For instance, this code should set up a UNIX signal
warp/Network/Wai/Handler/Warp/Internal.hs−13
@@ -3,10 +3,6 @@
33module Network.Wai.Handler.Warp.Internal (
44 -- * Settings
55 Settings (..)
6− -- ** Getters
7− , getOnOpen
8− , getOnClose
9− , getOnException
106 -- * Low level run functions
117 , runSettingsConnection
128 , runSettingsConnectionMaker
@@ -76,12 +72,3 @@ import Network.Wai.Handler.Warp.SendFile
7672import Network.Wai.Handler.Warp.Settings
7773import Network.Wai.Handler.Warp.Timeout
7874import Network.Wai.Handler.Warp.Types
79−
80−getOnOpen :: Settings -> SockAddr -> IO Bool
81−getOnOpen = settingsOnOpen
82−
83−getOnClose :: Settings -> SockAddr -> IO ()
84−getOnClose = settingsOnClose
85−
86−getOnException :: Settings -> Maybe Request -> SomeException -> IO ()
87−getOnException = settingsOnException