void processSession (Job& job, HTTP::Session& session) { session.write (m_deprecatedHandler.processRequest ( session.content(), session.remoteAddress().withPort(0).to_string())); session.close(); }
// Dispatched on the job queue void ServerHandlerImp::processSession (Job& job, HTTP::Session& session) { auto const s (to_string(session.message().body)); session.write (processRequest (to_string(session.message().body), session.remoteAddress().at_port(0))); if (session.message().keep_alive()) { session.complete(); } else { session.close (true); } }
void ServerHandlerImp::onRequest (HTTP::Session& session) { // Check user/password authorization auto const headers (build_map (session.message().headers)); if (! HTTPAuthorized (headers)) { session.write (HTTPReply (403, "Forbidden")); session.close (true); return; } session.detach(); m_jobQueue.addJob (jtCLIENT, "RPC-Client", std::bind ( &ServerHandlerImp::processSession, this, std::placeholders::_1, std::ref (session))); }