X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FHttpd.hs;h=ac1dc77a66379508ac8f1bf2c0528c1f2ddd037a;hb=3baf479eba12bc3e9c4ef966df770cd70aa5cd81;hp=03fde6b714fde24a307005202ddb5564bd611a56;hpb=667baf9f664ccc093241287ad727b2839290f456;p=Lucu.git diff --git a/Network/HTTP/Lucu/Httpd.hs b/Network/HTTP/Lucu/Httpd.hs index 03fde6b..ac1dc77 100644 --- a/Network/HTTP/Lucu/Httpd.hs +++ b/Network/HTTP/Lucu/Httpd.hs @@ -46,9 +46,10 @@ import Prelude.Unicode -- > = Just $ do setContentType [mimeType| text/plain |] -- > putChunk "Hello, world!" -- > } +-- -- FIXME: update the above example -runHttpd ∷ Config → SchemeMap → IO () -runHttpd cnf sm +runHttpd ∷ HostMapper α ⇒ Config → α → IO () +runHttpd cnf hm = do let launchers = catMaybes [ do addr ← cnfServerV4Addr cnf @@ -107,7 +108,7 @@ runHttpd cnf sm httpLoop port so = do (h, addr) ← SL.accept so tQueue ← mkInteractionQueue - readerTID ← forkIO $ requestReader cnf sm h port addr tQueue + readerTID ← forkIO $ requestReader cnf hm h port addr tQueue _writerTID ← forkIO $ responseWriter cnf h tQueue readerTID httpLoop port so