CONFIGURE_ARGS = -O
-include cabal-package.mk
\ No newline at end of file
+include cabal-package.mk
+
+update-web: update-web-doc update-web-ditz
+
+update-web-doc: doc
+ rsync -av --delete \
+ dist/doc/html/Lucu/ \
+ www@nem.cielonegro.org:static.cielonegro.org/htdocs/doc/Lucu
+
+update-web-ditz: ditz
+ rsync -av --delete \
+ dist/ditz/ \
+ www@nem.cielonegro.org:static.cielonegro.org/htdocs/ditz/Lucu
Stability: experimental
Homepage: http://cielonegro.org/Lucu.html
Category: Network
-Tested-With: GHC == 6.12.1
+Tested-With: GHC == 7.0.3
Cabal-Version: >= 1.6
Build-Type: Simple
Extra-Source-Files:
Library
Build-Depends:
- HsOpenSSL == 0.8.*,
- base == 4.2.*,
+ HsOpenSSL == 0.10.*,
+ base == 4.3.*,
bytestring == 0.9.*,
- containers == 0.3.*,
- dataenc == 0.13.*,
- filepath == 1.1.*,
- directory == 1.0.*,
+ containers == 0.4.*,
+ dataenc == 0.14.*,
+ filepath == 1.2.*,
+ directory == 1.1.*,
haskell-src == 1.0.*,
- hxt == 8.5.*,
- mtl == 1.1.*,
- network == 2.2.*,
- stm == 2.1.*,
- time == 1.1.*,
+ hxt == 9.1.*,
+ mtl == 2.0.*,
+ network == 2.3.*,
+ stm == 2.2.*,
+ time == 1.2.*,
time-http == 0.1.*,
unix == 2.4.*,
zlib == 0.5.*
import System.IO.Unsafe
import Text.XML.HXT.Arrow.WriteDocument
import Text.XML.HXT.Arrow.XmlArrow
-import Text.XML.HXT.Arrow.XmlIOStateArrow
-import Text.XML.HXT.DOM.XmlKeywords
+import Text.XML.HXT.Arrow.XmlState
data Abortion = Abortion {
-> let [html] = unsafePerformIO
$ runX ( mkDefaultPage conf (aboStatus abo) (txt msg)
>>>
- writeDocumentToString [(a_indent, v_1)]
+ writeDocumentToString [ withIndent True ]
)
in
html
import System.IO.Unsafe
import Text.XML.HXT.Arrow.WriteDocument
import Text.XML.HXT.Arrow.XmlArrow
-import Text.XML.HXT.Arrow.XmlIOStateArrow
+import Text.XML.HXT.Arrow.XmlState
import Text.XML.HXT.DOM.TypeDefs
-import Text.XML.HXT.DOM.XmlKeywords
getDefaultPage :: Config -> Maybe Request -> Response -> String
unsafePerformIO $
do [xmlStr] <- runX ( mkDefaultPage conf (resStatus res) msgA
>>>
- writeDocumentToString [ (a_indent, v_1) ]
+ writeDocumentToString [ withIndent True ]
)
return xmlStr
)
where
-import Control.Monad.State.Strict
+import Control.Monad.State.Strict hiding (state)
import qualified Data.ByteString.Lazy as Lazy (ByteString)
import qualified Data.ByteString.Lazy.Char8 as B hiding (ByteString)
import qualified Data.Foldable as Fold
+{-# LANGUAGE
+ BangPatterns
+ #-}
module Network.HTTP.Lucu.Preprocess
( preprocess
)
-}
preprocess :: Interaction -> STM ()
-preprocess itr
- = itr `seq`
- do req <- readItr itr itrRequest fromJust
+preprocess !itr
+ = do req <- readItr itr itrRequest fromJust
let reqVer = reqVersion req
updateAuthority :: Strict.ByteString -> Strict.ByteString -> STM ()
- updateAuthority host portStr
- = host `seq` portStr `seq`
- updateItr itr itrRequest
+ updateAuthority !host !portStr
+ = updateItr itr itrRequest
$! \ (Just req) -> Just req {
reqURI = let uri = reqURI req
in uri {
preprocessHeader :: Request -> STM ()
- preprocessHeader req
- = req `seq`
- do case getHeader (C8.pack "Expect") req of
+ preprocessHeader !req
+ = do case getHeader (C8.pack "Expect") req of
Nothing -> return ()
Just value -> if value `noCaseEq` C8.pack "100-continue" then
writeItr itr itrExpectedContinue True
-- |Tell the system that the 'Resource' found an entity for the
-- request URI. If this is a GET or HEAD request, a found entity means
-- a datum to be replied. If this is a PUT or DELETE request, it means
--- a datum which was stored for the URI up to now. It is an error to
+-- a datum which was stored for the URI until now. It is an error to
-- compute 'foundEntity' if this is a POST request.
--
-- Computation of 'foundEntity' performs \"If-Match\" test or
$ setHeader' (C8.pack "Last-Modified") (C8.pack $ HTTP.format timeStamp)
when (method == POST)
$ abort InternalServerError []
- (Just "Illegal computation of foundEntity for POST request.")
+ (Just "Illegal computation of foundEntity for a POST request.")
foundETag tag
driftTo GettingBody
SUDO ?= sudo
AUTOCONF ?= autoconf
HLINT ?= hlint
+HPC ?= hpc
+DITZ ?= ditz
CONFIGURE_ARGS ?= --disable-optimization
build: setup-config build-hook
./Setup build
+ $(RM_RF) *.tix
build-hook:
$(GHC) --make Setup
clean: clean-hook
- $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo
+ $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo *.tix .hpc
$(FIND) . -name '*~' -exec rm -f {} \;
clean-hook:
./Setup sdist
test: build
+ $(RM_RF) dist/test
./Setup test
+ if ls *.tix >/dev/null 2>&1; then \
+ $(HPC) sum --output="merged.tix" --union --exclude=Main *.tix; \
+ $(HPC) markup --destdir="dist/hpc" --fun-entry-count "merged.tix"; \
+ fi
+
+ditz:
+ $(DITZ) html dist/ditz
+
+fixme:
+ @$(FIND) . \
+ \( -name 'dist' -or -name '.git' -or -name '_darcs' \) -prune \
+ -or \
+ \( -name '*.c' -or -name '*.h' -or \
+ -name '*.hs' -or -name '*.lhs' -or \
+ -name '*.hsc' -or -name '*.cabal' \) \
+ -exec egrep -i '(fixme|thinkme)' {} \+ \
+ || echo 'No FIXME or THINKME found.'
lint:
- $(HLINT) . --report \
- --ignore="Use string literal" \
- --ignore="Use concatMap"
+ $(HLINT) . --report
+# $(HLINT) . --report \
+# --ignore="Use string literal" \
+# --ignore="Use concatMap"
.PHONY: build build-hook setup-config setup-config-hook run clean clean-hook install doc sdist test lint