requestEvent :: ServId -> WhichServer -> Word64 -> ReqInfo -> Ev
requestEvent srvId which reqId ReqInfo{..} = reqEv srvId reqUd which riAdr evReq
 where
  evBod = bodFile riBod
  evHdr = convertHeaders riHdr
  evUrl = Cord (decodeUtf8Lenient riUrl)
  evReq = HttpRequest riMet evUrl evHdr evBod
  reqUd = fromIntegral reqId

  bodFile :: ByteString -> Maybe File
  bodFile "" = Nothing
  bodFile bs = Just $ File $ Octs bs


-- Running Servers -------------------------------------------------------------
requestEvent :: ServId -> WhichServer -> Word64 -> ReqInfo -> Ev
requestEvent srvId which reqId ReqInfo{..} = reqEv srvId reqUd which riAdr evReq
 where
  evBod = bodFile riBod
  evHdr = convertHeaders riHdr
  evUrl = Cord (decodeUtf8Lenient riUrl)
  evReq = HttpRequest riMet evUrl evHdr evBod
  reqUd = fromIntegral reqId

  bodFile :: ByteString -> Maybe File
  bodFile "" = Nothing
  bodFile bs = Just $ File $ Octs bs


-- Running Servers -------------------------------------------------------------
requestEvent srvId which reqId ReqInfo{..} = reqEv srvId reqUd which riAdr evReq
 where
  evBod = bodFile riBod
  evHdr = convertHeaders riHdr
  evUrl = Cord (decodeUtf8Lenient riUrl)
  evReq = HttpRequest riMet evUrl evHdr evBod
  reqUd = fromIntegral reqId

  bodFile :: ByteString -> Maybe File
  bodFile "" = Nothing
  bodFile bs = Just $ File $ Octs bs


-- Running Servers -------------------------------------------------------------