summaryrefslogtreecommitdiffstats
path: root/src/shrpx_connection_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shrpx_connection_handler.h')
-rw-r--r--src/shrpx_connection_handler.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/shrpx_connection_handler.h b/src/shrpx_connection_handler.h
index f3748ab..47ec209 100644
--- a/src/shrpx_connection_handler.h
+++ b/src/shrpx_connection_handler.h
@@ -108,7 +108,7 @@ struct SerialEvent {
struct BPFRef {
bpf_object *obj;
bpf_map *reuseport_array;
- bpf_map *cid_prefix_map;
+ bpf_map *worker_id_map;
};
# endif // HAVE_LIBBPF
@@ -121,12 +121,10 @@ enum class QUICIPCType {
// WorkerProcesses which are in graceful shutdown period.
struct QUICLingeringWorkerProcess {
- QUICLingeringWorkerProcess(
- std::vector<std::array<uint8_t, SHRPX_QUIC_CID_PREFIXLEN>> cid_prefixes,
- int quic_ipc_fd)
- : cid_prefixes{std::move(cid_prefixes)}, quic_ipc_fd{quic_ipc_fd} {}
+ QUICLingeringWorkerProcess(std::vector<WorkerID> worker_ids, int quic_ipc_fd)
+ : worker_ids{std::move(worker_ids)}, quic_ipc_fd{quic_ipc_fd} {}
- std::vector<std::array<uint8_t, SHRPX_QUIC_CID_PREFIXLEN>> cid_prefixes;
+ std::vector<WorkerID> worker_ids;
// Socket to send QUIC IPC message to this worker process.
int quic_ipc_fd;
};
@@ -197,25 +195,23 @@ public:
int forward_quic_packet(const UpstreamAddr *faddr, const Address &remote_addr,
const Address &local_addr, const ngtcp2_pkt_info &pi,
- const uint8_t *cid_prefix, const uint8_t *data,
+ const WorkerID &wid, const uint8_t *data,
size_t datalen);
void set_quic_keying_materials(std::shared_ptr<QUICKeyingMaterials> qkms);
const std::shared_ptr<QUICKeyingMaterials> &get_quic_keying_materials() const;
- void set_cid_prefixes(
- const std::vector<std::array<uint8_t, SHRPX_QUIC_CID_PREFIXLEN>>
- &cid_prefixes);
+ void set_worker_ids(std::vector<WorkerID> worker_ids);
+ Worker *find_worker(const WorkerID &wid) const;
void set_quic_lingering_worker_processes(
const std::vector<QUICLingeringWorkerProcess> &quic_lwps);
- // Return matching QUICLingeringWorkerProcess which has a CID prefix
+ // Return matching QUICLingeringWorkerProcess which has a Worker ID
// such that |dcid| starts with it. If no such
// QUICLingeringWorkerProcess, it returns nullptr.
QUICLingeringWorkerProcess *
- match_quic_lingering_worker_process_cid_prefix(const uint8_t *dcid,
- size_t dcidlen);
+ match_quic_lingering_worker_process_worker_id(const WorkerID &wid);
int forward_quic_packet_to_lingering_worker_process(
QUICLingeringWorkerProcess *quic_lwp, const Address &remote_addr,
@@ -260,9 +256,8 @@ private:
// and signature algorithm presented by client.
std::vector<std::vector<SSL_CTX *>> indexed_ssl_ctx_;
#ifdef ENABLE_HTTP3
- std::vector<std::array<uint8_t, SHRPX_QUIC_CID_PREFIXLEN>> cid_prefixes_;
- std::vector<std::array<uint8_t, SHRPX_QUIC_CID_PREFIXLEN>>
- lingering_cid_prefixes_;
+ std::vector<WorkerID> worker_ids_;
+ std::vector<WorkerID> lingering_worker_ids_;
int quic_ipc_fd_;
std::vector<QUICLingeringWorkerProcess> quic_lingering_worker_processes_;
# ifdef HAVE_LIBBPF