mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
USE_POST_SIZE_LIMIT -> MONGOOSE_USE_POST_SIZE_LIMIT, and unit test added
This commit is contained in:
1 parent
192205b10b
commit
93c5335d80
2 files changed
+24
-5
No files matched your search
+3
-4
@@ -675,9 +675,8 @@ static void send_http_error(struct connection *conn, int code,
|
||||
|
||||
body_len = mg_snprintf(body, sizeof(body), "%d %s\n", code, message);
|
||||
if (fmt != NULL) {
|
||||
body[body_len++] = '\n';
|
||||
va_start(ap, fmt);
|
||||
body_len += mg_snprintf(body + body_len, sizeof(body) - body_len, fmt, ap);
|
||||
body_len += mg_vsnprintf(body + body_len, sizeof(body) - body_len, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
if (code >= 300 && code <= 399) {
|
||||
@@ -3358,9 +3357,9 @@ static void open_local_endpoint(struct connection *conn) {
|
||||
{
|
||||
const char *cl = mg_get_header(&conn->mg_conn, "Content-Length");
|
||||
if (!strcmp(conn->mg_conn.request_method, "POST") &&
|
||||
(cl == NULL || to64(cl) > USE_POST_SIZE_LIMIT)) {
|
||||
(cl == NULL || to64(cl) > MONGOOSE_USE_POST_SIZE_LIMIT)) {
|
||||
send_http_error(conn, 500, "POST size > %zu",
|
||||
(size_t) USE_POST_SIZE_LIMIT);
|
||||
(size_t) MONGOOSE_USE_POST_SIZE_LIMIT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user