nb: add request-specific handlers

Change-Id: I219fc9ef23c6c9e646dd609bb3ece2607ca78828
This commit is contained in:
Ashod Nakashian 2017-02-25 12:21:32 -05:00 committed by Jan Holesovsky
parent d9d6bfdb80
commit 3602526f5b

View file

@ -2419,20 +2419,17 @@ private:
// File server
if (reqPathSegs.size() >= 1 && reqPathSegs[0] == "loleaflet")
{
// requestHandler = FileServer::createRequestHandler();
LOG_INF("FileServer request");
handleFileServerRequest(request);
}
// Admin LOOLWebSocket Connections
else if (reqPathSegs.size() >= 2 && reqPathSegs[0] == "lool" && reqPathSegs[1] == "adminws")
{
// requestHandler = Admin::createRequestHandler();
LOG_INF("Admin request");
handleAdminRequest(request);
}
// Client post and websocket connections
else
{
// requestHandler = new ClientRequestHandler();
LOG_INF("Client request");
handleClientRequest(request);
}
}
catch (const std::exception& exc)
@ -2442,6 +2439,24 @@ private:
}
}
void handleFileServerRequest(const Poco::Net::HTTPRequest& request)
{
LOG_ERR("FileServer request: " << request.getURI());
// requestHandler = FileServer::createRequestHandler();
}
void handleAdminRequest(const Poco::Net::HTTPRequest& request)
{
LOG_ERR("Admin request" << request.getURI());
// requestHandler = Admin::createRequestHandler();
}
void handleClientRequest(const Poco::Net::HTTPRequest& request)
{
// requestHandler = new ClientRequestHandler();
LOG_INF("Client request" << request.getURI());
}
private:
std::unique_ptr<StreamSocket> _socket;
};