Use snake_case for Connection etc methods
This commit is contained in:
@@ -28,7 +28,7 @@ HttpConnectionState::HttpConnectionState(ArenaAllocator &arena)
|
||||
// HttpHandler implementation
|
||||
void HttpHandler::on_connection_established(Connection &conn) {
|
||||
// Allocate HTTP state in connection's arena
|
||||
ArenaAllocator &arena = conn.getArena();
|
||||
ArenaAllocator &arena = conn.get_arena();
|
||||
void *mem = arena.allocate_raw(sizeof(HttpConnectionState),
|
||||
alignof(HttpConnectionState));
|
||||
auto *state = new (mem) HttpConnectionState(arena);
|
||||
@@ -249,7 +249,7 @@ void HttpHandler::handleNotFound(Connection &conn,
|
||||
void HttpHandler::sendResponse(Connection &conn, int status_code,
|
||||
std::string_view content_type,
|
||||
std::string_view body, bool close_connection) {
|
||||
[[maybe_unused]] ArenaAllocator &arena = conn.getArena();
|
||||
[[maybe_unused]] ArenaAllocator &arena = conn.get_arena();
|
||||
|
||||
// Build HTTP response using arena
|
||||
std::string response;
|
||||
@@ -293,7 +293,7 @@ void HttpHandler::sendResponse(Connection &conn, int status_code,
|
||||
|
||||
if (close_connection) {
|
||||
response += "Connection: close\r\n";
|
||||
conn.closeAfterSend(); // Signal connection should be closed after sending
|
||||
conn.close_after_send(); // Signal connection should be closed after sending
|
||||
} else {
|
||||
response += "Connection: keep-alive\r\n";
|
||||
}
|
||||
@@ -301,7 +301,7 @@ void HttpHandler::sendResponse(Connection &conn, int status_code,
|
||||
response += "\r\n";
|
||||
response += body;
|
||||
|
||||
conn.appendMessage(response);
|
||||
conn.append_message(response);
|
||||
}
|
||||
|
||||
void HttpHandler::sendJsonResponse(Connection &conn, int status_code,
|
||||
@@ -313,7 +313,7 @@ void HttpHandler::sendJsonResponse(Connection &conn, int status_code,
|
||||
void HttpHandler::sendErrorResponse(Connection &conn, int status_code,
|
||||
std::string_view message,
|
||||
bool close_connection) {
|
||||
[[maybe_unused]] ArenaAllocator &arena = conn.getArena();
|
||||
[[maybe_unused]] ArenaAllocator &arena = conn.get_arena();
|
||||
|
||||
std::string json = R"({"error":")";
|
||||
json += message;
|
||||
|
||||
Reference in New Issue
Block a user