]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Resource/Internal.hs
Code reorganisation
[Lucu.git] / Network / HTTP / Lucu / Resource / Internal.hs
index 9feca7edf6e3b6401fc7e4306705a420553fe016..d0d18b79afe6bcd5de2dbe4810fbac0e51d65120 100644 (file)
@@ -47,11 +47,11 @@ import Data.ByteString (ByteString)
 import qualified Data.ByteString as BS
 import Data.Collections
 import Data.Convertible.Base
+import Data.Convertible.Instances.Text ()
 import Data.List (intersperse, nub)
 import Data.Maybe
 import Data.Monoid
 import Data.Monoid.Unicode
-import qualified Data.Text as T
 import Network.HTTP.Lucu.Abortion
 import Network.HTTP.Lucu.Abortion.Internal
 import Network.HTTP.Lucu.Config
@@ -61,6 +61,7 @@ import Network.HTTP.Lucu.Interaction
 import Network.HTTP.Lucu.Postprocess
 import Network.HTTP.Lucu.Request
 import Network.HTTP.Lucu.Response
+import Network.HTTP.Lucu.Response.StatusCode
 import Network.HTTP.Lucu.Utils
 import Network.Socket
 #if defined(HAVE_SSL)
@@ -202,7 +203,7 @@ spawnRsrc (Resource {..}) ni@(NI {..})
       toAbortion e
           = case fromException e of
               Just abortion → abortion
-              Nothing       → mkAbortion' InternalServerError $ T.pack $ show e
+              Nothing       → mkAbortion' InternalServerError $ cs $ show e
 
       processException ∷ SomeException → IO ()
       processException exc
@@ -302,7 +303,7 @@ getChunk' n
     | n < 0     = fail ("getChunk: n must not be negative: " ⧺ show n)
     | n ≡ 0     = return (∅)
     | otherwise = do req ← getRequest
-                     if reqMustHaveBody req then
+                     if reqHasBody req then
                          askForInput =≪ getInteraction
                      else
                          driftTo DecidingHeader *> return (∅)