]> gitweb @ CieloNegro.org - Lucu.git/commitdiff
rename: reqMustHaveBody --> reqHasBody
authorPHO <pho@cielonegro.org>
Tue, 20 Dec 2011 01:59:01 +0000 (10:59 +0900)
committerPHO <pho@cielonegro.org>
Tue, 20 Dec 2011 01:59:01 +0000 (10:59 +0900)
Network/HTTP/Lucu/Preprocess.hs
Network/HTTP/Lucu/Request.hs
Network/HTTP/Lucu/RequestReader.hs
Network/HTTP/Lucu/Resource/Internal.hs

index 1915b1bd44e3a93f95ffba41f922d3f2bea0bc94..0848f15124e590205a9b4d5d44c89a8b071e3c2a 100644 (file)
@@ -196,7 +196,7 @@ examineBodyLength ∷ State AugmentedRequest ()
 examineBodyLength
     = do req ← gets arRequest
          len ← gets arReqBodyLength
-         if reqMustHaveBody req then
+         if reqHasBody req then
              -- POST and PUT requests must have an entity body.
              when (isNothing len)
                  $ setStatus LengthRequired
index 2fcfc9123e3c8e07f343ba3d9211556d4a4c2ed7..b6ffedbdb11ccf2ef0bfa2701998d0183e82c808 100644 (file)
@@ -10,7 +10,7 @@
 module Network.HTTP.Lucu.Request
     ( Method(..)
     , Request(..)
-    , reqMustHaveBody
+    , reqHasBody
     )
     where
 import Control.Applicative
@@ -55,10 +55,10 @@ instance HasHeaders Request where
     {-# INLINE setHeaders #-}
     setHeaders req hdr = req { reqHeaders = hdr }
 
--- |Returns 'True' iff the 'Request' must have an entity body.
-reqMustHaveBody ∷ Request → Bool
-{-# INLINEABLE reqMustHaveBody #-}
-reqMustHaveBody (reqMethod → m)
+-- |Returns 'True' iff the 'Request' would have an entity body.
+reqHasBody ∷ Request → Bool
+{-# INLINEABLE reqHasBody #-}
+reqHasBody (reqMethod → m)
     | m ≡ POST  = True
     | m ≡ PUT   = True
     | otherwise = False
index 91aa86dc61be20313b4b672b59806177441d3399..062ffe204ec192e5f5b0d0e52131f352989752d4 100644 (file)
@@ -151,7 +151,7 @@ acceptRequestForResource ctx@(Context {..}) ar@(AugmentedRequest {..}) input rsr
 #endif
          tid  ← spawnRsrc rsrcDef ni
          enqueue ctx ni
-         if reqMustHaveBody arRequest then
+         if reqHasBody arRequest then
              waitForReceiveBodyReq ctx ni tid input
          else
              acceptRequest ctx input
index 1993eb251deafdb09dbb98f0916601b581dc5a15..b13d3a9f14062e76b3090086cf992f98aae03f4c 100644 (file)
@@ -302,7 +302,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 (∅)