on master help sign in
Exporting Date.
commit3d9cda9b812c964fc528cd6de1a85be981a79531 authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 5 Nov 2013, 21:05 (13 years ago) parent74a9a07
2 files changed+8−6
warp/Network/Wai/Handler/Warp.hs+4−6 warp/Network/Wai/Handler/Warp/Date.hs+4
warp/Network/Wai/Handler/Warp.hs+4−6
@@ -56,22 +56,20 @@ module Network.Wai.Handler.Warp (
5656 , module Network.Wai.Handler.Warp.Timeout
5757 -- ** File descriptor cache
5858 , module Network.Wai.Handler.Warp.FdCache
59+ -- ** Date
60+ , module Network.Wai.Handler.Warp.Date
5961 -- ** Request and response
6062 , recvRequest
6163 , sendResponse
62−#if TEST
63− , takeHeaders
64− , parseFirst
65− , readInt
66−#endif
6764 ) where
6865
6966import Data.Conduit.Network (HostPreference(..))
67+import Network.Wai.Handler.Warp.Date
7068import Network.Wai.Handler.Warp.FdCache
69+import Network.Wai.Handler.Warp.Header
7170import Network.Wai.Handler.Warp.Request
7271import Network.Wai.Handler.Warp.Response
7372import Network.Wai.Handler.Warp.Run
7473import Network.Wai.Handler.Warp.Settings
7574import Network.Wai.Handler.Warp.Timeout
7675import Network.Wai.Handler.Warp.Types
77−import Network.Wai.Handler.Warp.Header
warp/Network/Wai/Handler/Warp/Date.hs+4
@@ -22,10 +22,13 @@ import Network.HTTP.Date
2222import System.Posix (epochTime)
2323#endif
2424
25+-- | The type of the Date header value.
2526type GMTDate = ByteString
2627
28+-- | The type of the cache of the Date header value.
2729data DateCache = DateCache (IORef GMTDate)
2830
31+-- | Creating 'DateCache' and executing the action.
2932withDateCache :: (DateCache -> IO a) -> IO a
3033withDateCache action = bracket initialize
3134 (\(t,_) -> killThread t)
@@ -39,6 +42,7 @@ initialize = do
3942 update dc
4043 return (t, dc)
4144
45+-- | Getting 'GMTDate' based on 'DateCache'.
4246getDate :: DateCache -> IO GMTDate
4347getDate (DateCache ref) = readIORef ref
4448