diff --git a/include/cinatra/coro_http_connection.hpp b/include/cinatra/coro_http_connection.hpp index 0785ef47..cf66d459 100644 --- a/include/cinatra/coro_http_connection.hpp +++ b/include/cinatra/coro_http_connection.hpp @@ -681,14 +681,15 @@ class coro_http_connection head_buf_.consume(head_buf_.size()); std::span payload{}; auto payload_length = ws_.payload_length(); - + if (max_part_size_ != 0 && payload_length > max_part_size_) { std::string close_reason = "message_too_big"; std::string close_msg = ws_.format_close_payload( close_code::too_big, close_reason.data(), close_reason.size()); co_await write_websocket(close_msg, opcode::close); close(); - result.ec = std::error_code(asio::error::message_size, asio::error::get_system_category()); + result.ec = std::error_code(asio::error::message_size, + asio::error::get_system_category()); break; }