Call epoll_ctl in release stage
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "arena.hpp"
|
||||
#include "connection.hpp"
|
||||
#include <variant>
|
||||
|
||||
@@ -19,14 +20,21 @@ struct CommitEntry {
|
||||
// Copied HTTP state (pipeline threads cannot access connection user_data)
|
||||
int64_t http_request_id = 0;
|
||||
bool connection_close = false;
|
||||
const CommitRequest *commit_request =
|
||||
nullptr; // Points to connection's arena data
|
||||
const CommitRequest *commit_request = nullptr; // Points to request_arena data
|
||||
|
||||
// Request arena contains parsed request data and formatted response
|
||||
Arena request_arena;
|
||||
|
||||
// Response data (set by persist stage, consumed by release stage)
|
||||
// Points to response formatted in request_arena
|
||||
std::span<std::string_view> response_message;
|
||||
|
||||
CommitEntry() = default; // Default constructor for variant
|
||||
explicit CommitEntry(WeakRef<MessageSender> conn, int64_t req_id,
|
||||
bool close_conn, const CommitRequest *req)
|
||||
bool close_conn, const CommitRequest *req, Arena arena)
|
||||
: connection(std::move(conn)), http_request_id(req_id),
|
||||
connection_close(close_conn), commit_request(req) {}
|
||||
connection_close(close_conn), commit_request(req),
|
||||
request_arena(std::move(arena)) {}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -40,13 +48,18 @@ struct StatusEntry {
|
||||
// Copied HTTP state
|
||||
int64_t http_request_id = 0;
|
||||
bool connection_close = false;
|
||||
std::string_view status_request_id; // Points to connection's arena data
|
||||
std::string_view status_request_id; // Points to request_arena data
|
||||
|
||||
// Request arena for HTTP request data
|
||||
Arena request_arena;
|
||||
|
||||
StatusEntry() = default; // Default constructor for variant
|
||||
explicit StatusEntry(WeakRef<MessageSender> conn, int64_t req_id,
|
||||
bool close_conn, std::string_view request_id)
|
||||
bool close_conn, std::string_view request_id,
|
||||
Arena arena)
|
||||
: connection(std::move(conn)), http_request_id(req_id),
|
||||
connection_close(close_conn), status_request_id(request_id) {}
|
||||
connection_close(close_conn), status_request_id(request_id),
|
||||
request_arena(std::move(arena)) {}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -61,11 +74,18 @@ struct HealthCheckEntry {
|
||||
int64_t http_request_id = 0;
|
||||
bool connection_close = false;
|
||||
|
||||
// Request arena for formatting response
|
||||
Arena request_arena;
|
||||
|
||||
// Response data (set by persist stage, consumed by release stage)
|
||||
// Points to response formatted in request_arena
|
||||
std::span<std::string_view> response_message;
|
||||
|
||||
HealthCheckEntry() = default; // Default constructor for variant
|
||||
explicit HealthCheckEntry(WeakRef<MessageSender> conn, int64_t req_id,
|
||||
bool close_conn)
|
||||
bool close_conn, Arena arena)
|
||||
: connection(std::move(conn)), http_request_id(req_id),
|
||||
connection_close(close_conn) {}
|
||||
connection_close(close_conn), request_arena(std::move(arena)) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user