mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-09-25 07:47:58 +03:00
api: log JSON parse error (#904)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "client.h"
|
||||
#include "cfg/configurator.h"
|
||||
#include "external/rapidjson/document.h"
|
||||
#include "external/rapidjson/error/en.h"
|
||||
#include "util/crypt.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/utils.h"
|
||||
@@ -312,6 +313,8 @@ bool Controller::process_request(ClientState *state, const char *in, size_t in_s
|
||||
|
||||
// check for parse error
|
||||
if (document.HasParseError()) {
|
||||
log_warning("api", "Request JSON parse error: {} (byte offset {}, decrypted request length {} bytes)",
|
||||
GetParseError_En(document.GetParseError()), document.GetErrorOffset(), in_size);
|
||||
|
||||
// return empty response and close connection
|
||||
out->push_back(0);
|
||||
|
||||
Reference in New Issue
Block a user