acceptRequest (Context cnf tree fbs h port addr tQueue) input
`catches`
[ Handler handleAsyncE
- , Handler handleBIOS
, Handler handleOthers
]
`finally`
handleAsyncE ThreadKilled = return ()
handleAsyncE e = dump e
- handleBIOS ∷ BlockedIndefinitelyOnSTM → IO ()
- handleBIOS = dump
-
handleOthers ∷ SomeException → IO ()
handleOthers = dump
dump ∷ Exception e ⇒ e → IO ()
dump e
- = do hPutStrLn stderr "requestReader caught an exception:"
+ = do hPutStrLn stderr "Lucu: requestReader caught an exception:"
hPutStrLn stderr $ show e
acceptRequest ∷ HandleLike h ⇒ Context h → Lazy.ByteString → IO ()
→ AugmentedRequest
→ Lazy.ByteString
→ [Strict.ByteString]
- → ResourceDef
+ → Resource
→ IO ()
acceptRequestForResource ctx@(Context {..}) ar@(AugmentedRequest {..}) input rsrcPath rsrcDef
= do
#else
ni ← mkNormalInteraction cConfig cAddr ar rsrcPath
#endif
- tid ← spawnResource rsrcDef ni
+ tid ← spawnRsrc rsrcDef ni
enqueue ctx ni
if reqMustHaveBody arRequest then
waitForReceiveBodyReq ctx ni tid input