[CORE] Increase SDU buffer to 32k (#2008)

This commit is contained in:
Sukchan Lee 2023-01-24 21:43:20 +09:00
parent 43eb5f3d7f
commit 218b31d006
10 changed files with 58 additions and 29 deletions

View file

@ -382,7 +382,7 @@ static connection_t *connection_add(
request->h.uri = uri;
}
curl_easy_setopt(conn->easy, CURLOPT_BUFFERSIZE, OGS_MAX_SDU_LEN*2);
curl_easy_setopt(conn->easy, CURLOPT_BUFFERSIZE, OGS_MAX_SDU_LEN);
curl_easy_setopt(conn->easy, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(conn->easy, CURLOPT_SSL_VERIFYHOST, 0);

View file

@ -2239,7 +2239,7 @@ static int on_part_data(
} else {
offset = data->part[data->num_of_part].content_length;
if ((data->part[data->num_of_part].content_length + length) >
OGS_HUGE_LEN) {
OGS_MAX_SDU_LEN) {
ogs_error("Overflow length [%d:%d]",
(int)data->part[data->num_of_part].content_length,
(int)length);
@ -2414,12 +2414,12 @@ static bool build_multipart(
strcpy(boundary, "=-");
ogs_base64_encode_binary(boundary + 2, digest, 16);
p = http->content = ogs_calloc(1, OGS_HUGE_LEN);
p = http->content = ogs_calloc(1, OGS_MAX_SDU_LEN);
if (!p) {
ogs_error("ogs_calloc() failed");
return false;
}
last = p + OGS_HUGE_LEN;
last = p + OGS_MAX_SDU_LEN;
/* First boundary */
p = ogs_slprintf(p, last, "--%s\r\n", boundary);

View file

@ -543,7 +543,7 @@ static _MHD_Result access_handler(
} else {
offset = request->http.content_length;
if ((request->http.content_length +
*upload_data_size) > OGS_HUGE_LEN) {
*upload_data_size) > OGS_MAX_SDU_LEN) {
ogs_error("Overflow : Content-Length[%d], upload_data_size[%d]",
(int)request->http.content_length,
(int)*upload_data_size);