diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-12-21 17:21:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-21 17:21:56 +0200 |
commit | 8dac5a52bb0e14320fa8fe4a24b9af4fc419fad1 (patch) | |
tree | 4f921683af0159f3c1a9db018dd0a3da63707251 /aclk | |
parent | 91989d191c1c933d1a46206ca74c6eec5e908d70 (diff) |
increase max response size to 100MiB (#16649)
* increase max response size to 100MiB
* do not check the uncompressed message size on aclk
Diffstat (limited to 'aclk')
-rw-r--r-- | aclk/aclk_query.c | 8 | ||||
-rw-r--r-- | aclk/aclk_tx_msgs.c | 4 |
2 files changed, 2 insertions, 10 deletions
diff --git a/aclk/aclk_query.c b/aclk/aclk_query.c index ee053d9e67..1f2ec864c8 100644 --- a/aclk/aclk_query.c +++ b/aclk/aclk_query.c @@ -6,7 +6,6 @@ #include "../../web/server/web_client_cache.h" #define WEB_HDR_ACCEPT_ENC "Accept-Encoding:" -#define ACLK_MAX_WEB_RESPONSE_SIZE (30 * 1024 * 1024) pthread_cond_t query_cond_wait = PTHREAD_COND_INITIALIZER; pthread_mutex_t query_lock_wait = PTHREAD_MUTEX_INITIALIZER; @@ -137,13 +136,6 @@ static int http_api_v2(struct aclk_query_thread *query_thr, aclk_query_t query) w->response.code = (short)web_client_api_request_with_node_selection(localhost, w, path); web_client_timeout_checkpoint_response_ready(w, &t); - if(buffer_strlen(w->response.data) > ACLK_MAX_WEB_RESPONSE_SIZE) { - buffer_flush(w->response.data); - buffer_strcat(w->response.data, "response is too big"); - w->response.data->content_type = CT_TEXT_PLAIN; - w->response.code = HTTP_RESP_CONTENT_TOO_LONG; - } - if (aclk_stats_enabled) { ACLK_STATS_LOCK; aclk_metrics_per_sample.cloud_q_process_total += t; diff --git a/aclk/aclk_tx_msgs.c b/aclk/aclk_tx_msgs.c index 4102c818d3..0e4182a729 100644 --- a/aclk/aclk_tx_msgs.c +++ b/aclk/aclk_tx_msgs.c @@ -86,7 +86,7 @@ static int aclk_send_message_with_bin_payload(mqtt_wss_client client, json_objec int rc = mqtt_wss_publish5(client, (char*)topic, NULL, full_msg, &freez_aclk_publish5b, full_msg_len, MQTT_WSS_PUB_QOS1, &packet_id); if (rc == MQTT_WSS_ERR_TOO_BIG_FOR_SERVER) - return HTTP_RESP_FORBIDDEN; + return HTTP_RESP_CONTENT_TOO_LONG; #ifdef NETDATA_INTERNAL_CHECKS aclk_stats_msg_published(packet_id); @@ -194,7 +194,7 @@ int aclk_http_msg_v2(mqtt_wss_client client, const char *topic, const char *msg_ int rc = aclk_send_message_with_bin_payload(client, msg, topic, payload, payload_len); switch (rc) { - case HTTP_RESP_FORBIDDEN: + case HTTP_RESP_CONTENT_TOO_LONG: aclk_http_msg_v2_err(client, topic, msg_id, rc, CLOUD_EC_REQ_REPLY_TOO_BIG, CLOUD_EMSG_REQ_REPLY_TOO_BIG, NULL, 0); break; case HTTP_RESP_INTERNAL_SERVER_ERROR: |