X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;ds=inline;f=Network%2FHTTP%2FLucu%2FInteraction.hs;h=88cded5c339209fc2f1d023a50c28318747ca4fa;hb=46f1b85674e45e823f5b6c7a1f87b1faf8172b85;hp=6045d97752e9551f1cf449da20939f60adb56e9e;hpb=41b0d69438ec76c5bd070348cf9912dc72f3ff44;p=Lucu.git diff --git a/Network/HTTP/Lucu/Interaction.hs b/Network/HTTP/Lucu/Interaction.hs index 6045d97..88cded5 100644 --- a/Network/HTTP/Lucu/Interaction.hs +++ b/Network/HTTP/Lucu/Interaction.hs @@ -30,7 +30,7 @@ data Interaction = Interaction { itrConfig :: Config , itrRemoteHost :: HostName , itrResourcePath :: Maybe [String] - , itrRequest :: Maybe Request + , itrRequest :: TVar (Maybe Request) , itrResponse :: TVar Response -- FIXME: この三つは本來 TVar であるべきでないので、唯の Bool にす @@ -84,7 +84,8 @@ defaultPageContentType = "application/xhtml+xml" newInteraction :: Config -> HostName -> Maybe Request -> IO Interaction newInteraction conf host req - = do responce <- newTVarIO $ Response { + = do request <- newTVarIO $ req + responce <- newTVarIO $ Response { resVersion = HttpVersion 1 1 , resStatus = Ok , resHeaders = [("Content-Type", defaultPageContentType)] @@ -118,7 +119,7 @@ newInteraction conf host req itrConfig = conf , itrRemoteHost = host , itrResourcePath = Nothing - , itrRequest = req + , itrRequest = request , itrResponse = responce , itrRequestHasBody = requestHasBody