Only count request size when not writing to a file.

This commit is contained in:
Relintai 2024-03-10 07:05:25 +01:00
parent a993a5460c
commit 2f950e87d6

View File

@ -84,6 +84,7 @@ int HTTPParser::read_from_buffer(const char *p_buffer, const int p_data_length)
parsed_bytes = static_cast<int>(http_parser_execute(parser, settings, p_buffer, p_data_length));
if (!_upload_file_access) {
_current_request_size += parsed_bytes;
if (_current_request_size >= max_request_size) {
@ -92,6 +93,7 @@ int HTTPParser::read_from_buffer(const char *p_buffer, const int p_data_length)
PLOG_ERR("_current_request_size >= max_request_size");
#endif
}
}
return parsed_bytes;
}