ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
rate_event_s Struct Reference

The useful part of memory backend is in events, lock: together they describe what is pending, who owns it, and how much data is valid. Keep the object with its parent operation and use the parent cleanup path. More...

Data Fields

char key [256]
 Hash key: "ip_address:event_type".
uint64_t * timestamps
 Array of timestamps (circular buffer).
size_t count
 Number of events in buffer.
size_t capacity
 Buffer capacity.
size_t head
 Head index (oldest event).
UT_hash_handle hh
 uthash handle

Detailed Description

The useful part of memory backend is in events, lock: together they describe what is pending, who owns it, and how much data is valid. Keep the object with its parent operation and use the parent cleanup path.

Per-address, per-event timestamp ring used by the in-memory limiter

Per-address, per-event timestamp ring used by the in-memory limiter.

key combines the client address and event type; timestamps stores the recent event times, while count, capacity, and head manage the circular window. The hash handle lets the backend find this record quickly.

Definition at line 37 of file memory.c.

Field Documentation

◆ capacity

size_t rate_event_s::capacity

Buffer capacity.

Definition at line 41 of file memory.c.

◆ count

size_t rate_event_s::count

Number of events in buffer.

Definition at line 40 of file memory.c.

◆ head

size_t rate_event_s::head

Head index (oldest event).

Definition at line 42 of file memory.c.

◆ hh

UT_hash_handle rate_event_s::hh

uthash handle

Definition at line 43 of file memory.c.

◆ key

char rate_event_s::key[256]

Hash key: "ip_address:event_type".

Definition at line 38 of file memory.c.

◆ timestamps

uint64_t* rate_event_s::timestamps

Array of timestamps (circular buffer).

Definition at line 39 of file memory.c.


The documentation for this struct was generated from the following file: