mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd::client: Add unique client id monotonic counter.
This commit is contained in:
parent
69b0066c15
commit
756840b42c
2 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,7 @@ struct ircd::client
|
|||
static struct settings settings;
|
||||
static struct conf default_conf;
|
||||
static ctx::pool context;
|
||||
static uint64_t ctr; // monotonic
|
||||
|
||||
static void interrupt_all();
|
||||
static void close_all();
|
||||
|
@ -48,6 +49,7 @@ struct ircd::client
|
|||
unique_buffer<mutable_buffer> head_buffer;
|
||||
unique_buffer<mutable_buffer> content_buffer;
|
||||
std::shared_ptr<socket> sock;
|
||||
uint64_t id {++ctr};
|
||||
ctx::ctx *reqctx {nullptr};
|
||||
ircd::timer timer;
|
||||
size_t head_length {0};
|
||||
|
|
|
@ -36,6 +36,10 @@ ircd::client::context
|
|||
"client", settings.stack_size
|
||||
};
|
||||
|
||||
decltype(ircd::client::ctr)
|
||||
ircd::client::ctr
|
||||
{};
|
||||
|
||||
// Linkage for the container of all active clients for iteration purposes.
|
||||
template<>
|
||||
decltype(ircd::util::instance_list<ircd::client>::list)
|
||||
|
|
Loading…
Reference in a new issue