From e80c85fbff66f7fc2995d10186a4513c7cec76bf Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 28 Aug 2019 16:05:09 +0200 Subject: #915 set maximum REST API response to 64 Kbytes The existing 4 Kbytes might not be enough to store the results of the GET /clients request, extend it up to 64 Kbytes. --- sources/ogAdmServer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sources') diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp index c7e6cac..0d2bc66 100644 --- a/sources/ogAdmServer.cpp +++ b/sources/ogAdmServer.cpp @@ -3951,9 +3951,11 @@ static int og_client_not_authorized(struct og_client *cli) return -1; } +#define OG_MSG_RESPONSE_MAXLEN 65536 + static int og_client_ok(struct og_client *cli, char *buf_reply) { - char buf[4096] = {}; + char buf[OG_MSG_RESPONSE_MAXLEN] = {}; int err = 0, len; len = snprintf(buf, sizeof(buf), @@ -3977,9 +3979,9 @@ enum og_rest_method { static int og_client_state_process_payload_rest(struct og_client *cli) { + char buf_reply[OG_MSG_RESPONSE_MAXLEN] = {}; struct og_msg_params params = {}; enum og_rest_method method; - char buf_reply[4096] = {}; const char *cmd, *body; json_error_t json_err; json_t *root = NULL; -- cgit v1.2.3-18-g5258