-runHttpd :: Config -> ResTree -> IO ()
-runHttpd cnf tree
- = cnf `seq` tree `seq`
- withSocketsDo $
- do installHandler sigPIPE Ignore Nothing
- so <- listenOn (cnfServerPort cnf)
- loop so
- where
- loop :: Socket -> IO ()
- loop so
- -- 本當は Network.accept を使ひたいが、このアクションは勝手に
- -- リモートのIPを逆引きするので、使へない。
- = so `seq`
- do (h, addr) <- accept' so
- tQueue <- newInteractionQueue
- readerTID <- forkIO $ requestReader cnf tree h addr tQueue
- writerTID <- forkIO $ responseWriter cnf h tQueue readerTID
- loop so
+runHttpd :: Config -> ResTree -> [FallbackHandler] -> IO ()
+runHttpd cnf tree fbs
+ = withSocketsDo $
+ do _ <- installHandler sigPIPE Ignore Nothing