]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Interaction.hs
Honor cnfServerV4Addr and cnfServerV6Addr.
[Lucu.git] / Network / HTTP / Lucu / Interaction.hs
index 5da428d4968ff225e31ac84fa003f013fbdf3d77..4c93b41abf258999aa329121c98d90b43d666ffa 100644 (file)
@@ -31,6 +31,7 @@ import           OpenSSL.X509
 
 data Interaction = Interaction {
       itrConfig       :: !Config
+    , itrLocalPort    :: !PortNumber
     , itrRemoteAddr   :: !SockAddr
     , itrRemoteCert   :: !(Maybe X509)
     , itrResourcePath :: !(Maybe [String])
@@ -82,8 +83,8 @@ defaultPageContentType :: Strict.ByteString
 defaultPageContentType = C8.pack "application/xhtml+xml"
 
 
-newInteraction :: Config -> SockAddr -> Maybe X509 -> Maybe Request -> IO Interaction
-newInteraction !conf !addr !cert !req
+newInteraction :: Config -> PortNumber -> SockAddr -> Maybe X509 -> Maybe Request -> IO Interaction
+newInteraction !conf !port !addr !cert !req
     = do request  <- newTVarIO req
          responce <- newTVarIO Response {
                        resVersion = HttpVersion 1 1
@@ -117,6 +118,7 @@ newInteraction !conf !addr !cert !req
 
          return Interaction {
                       itrConfig       = conf
+                    , itrLocalPort    = port
                     , itrRemoteAddr   = addr
                     , itrRemoteCert   = cert
                     , itrResourcePath = Nothing