mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
requesthandler: Profile requests if PLUGIN_TESTS is enabled
This commit is contained in:
parent
e451a8d6b0
commit
35c8a87def
@ -17,6 +17,10 @@ You should have received a copy of the GNU General Public License along
|
|||||||
with this program. If not, see <https://www.gnu.org/licenses/>
|
with this program. If not, see <https://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef PLUGIN_TESTS
|
||||||
|
#include <util/profiler.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "RequestHandler.h"
|
#include "RequestHandler.h"
|
||||||
|
|
||||||
const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_handlerMap
|
const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_handlerMap
|
||||||
@ -150,6 +154,10 @@ RequestHandler::RequestHandler(SessionPtr session) :
|
|||||||
|
|
||||||
RequestResult RequestHandler::ProcessRequest(const Request& request)
|
RequestResult RequestHandler::ProcessRequest(const Request& request)
|
||||||
{
|
{
|
||||||
|
#ifdef PLUGIN_TESTS
|
||||||
|
ScopeProfiler prof{"obs_websocket_request_processing"};
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!request.RequestData.is_object() && !request.RequestData.is_null())
|
if (!request.RequestData.is_object() && !request.RequestData.is_null())
|
||||||
return RequestResult::Error(RequestStatus::InvalidRequestFieldType, "Your request data is not an object.");
|
return RequestResult::Error(RequestStatus::InvalidRequestFieldType, "Your request data is not an object.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user