Commit 73f00d59 authored by Philipp Schafft's avatar Philipp Schafft

Update: Make connection IDs it's own type

parent d08eba96
Pipeline #242 failed with stage
in 15 seconds
......@@ -90,7 +90,7 @@ typedef struct client_queue_tag {
} client_queue_t;
static spin_t _connection_lock; // protects _current_id, _con_queue, _con_queue_tail
static volatile unsigned long _current_id = 0;
static volatile connection_id_t _current_id = 0;
static int _initialized = 0;
static volatile client_queue_t *_req_queue = NULL, **_req_queue_tail = &_req_queue;
......@@ -149,9 +149,9 @@ void connection_reread_config(ice_config_t *config)
listensocket_container_configure_and_setup(global.listensockets, config);
}
static unsigned long _next_connection_id(void)
static connection_id_t _next_connection_id(void)
{
unsigned long id;
connection_id_t id;
thread_spin_lock(&_connection_lock);
id = _current_id++;
......
......@@ -24,8 +24,10 @@
#include "common/thread/thread.h"
#include "common/net/sock.h"
typedef unsigned long connection_id_t;
struct connection_tag {
unsigned long id;
connection_id_t id;
time_t con_time;
time_t discon_time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment