]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Interaction.hs
lots of bugfixes regarding SSL support
[Lucu.git] / Network / HTTP / Lucu / Interaction.hs
index 018ee00d0eaa65e197c508a8d8d7c968d2fb3fe2..6aee0f7296ac6bf0ff34da081e3f3413a8e72653 100644 (file)
@@ -9,6 +9,7 @@
 module Network.HTTP.Lucu.Interaction
     ( Interaction(..)
     , SomeInteraction(..)
+    , EndOfInteraction(..)
 
     , SyntacticallyInvalidInteraction(..)
     , mkSyntacticallyInvalidInteraction
@@ -24,7 +25,6 @@ module Network.HTTP.Lucu.Interaction
     , InteractionQueue
     , mkInteractionQueue
 
-    , setResponseStatus
     , getCurrentDate
     )
     where
@@ -64,6 +64,13 @@ instance Interaction SomeInteraction where
     toInteraction   = id
     fromInteraction = Just
 
+-- |'EndOfInteraction' is an 'Interaction' indicating the end of
+-- (possibly pipelined) requests. The connection has already been
+-- closed so no need to reply anything.
+data EndOfInteraction = EndOfInteraction
+    deriving Typeable
+instance Interaction EndOfInteraction
+
 -- |'SyntacticallyInvalidInteraction' is an 'Interaction' without even
 -- a syntactically valid 'Request'. The response code will always be
 -- 'BadRequest'.
@@ -230,14 +237,5 @@ type InteractionQueue = TVar (Seq SomeInteraction)
 mkInteractionQueue ∷ IO InteractionQueue
 mkInteractionQueue = newTVarIO (∅)
 
--- FIXME: Response.hs should provide setStatus ∷ sc → Response → Response
-setResponseStatus ∷ StatusCode sc ⇒ NormalInteraction → sc → STM ()
-setResponseStatus (NI {..}) sc
-    = do res ← readTVar niResponse
-         let res' = res {
-                      resStatus = fromStatusCode sc
-                    }
-         writeTVar niResponse res'
-
 getCurrentDate ∷ IO Ascii
 getCurrentDate = HTTP.toAscii <$> getCurrentTime