From f7b81857f492af166d80f35508d9a3b5069532aa Mon Sep 17 00:00:00 2001 From: Ajay Sabat Date: Tue, 7 Nov 2023 18:03:06 -0800 Subject: [PATCH] [mod_verto] addressed review comments --- src/mod/endpoints/mod_verto/mod_verto.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 8514824958..e98a369874 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1775,19 +1775,20 @@ new_req: char *buffer = NULL; switch_ssize_t len = 0, bytes = 0; - if (request->content_length && request->content_length > 10 * 1024 * 1024 - 1) { + if (request->content_length > 10 * 1024 * 1024 - 1) { char *data = "HTTP/1.1 413 Request Entity Too Large\r\n" "Content-Length: 0\r\n\r\n"; + kws_raw_write(jsock->ws, data, strlen(data)); request->keepalive = 0; goto done; } - if (!(buffer = malloc(2 * 1024 * 1024))) { + if (!(buffer = malloc(10 * 1024 * 1024))) { goto request_err; } - while(bytes < (switch_ssize_t)request->content_length) { + while (bytes < (switch_ssize_t)request->content_length) { len = request->content_length - bytes; #define WS_BLOCK 1