summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2019-08-28 16:05:09 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-08-28 17:15:35 +0200
commite80c85fbff66f7fc2995d10186a4513c7cec76bf (patch)
tree06f5ce3dde95624f0191bc083302ebe7a465ce31
parent7e6ba45f953474033618db5172c7ea5b63dc7b9c (diff)
#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.
-rw-r--r--sources/ogAdmServer.cpp6
1 files changed, 4 insertions, 2 deletions
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;