Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
73f00d59
Commit
73f00d59
authored
Jul 06, 2018
by
Philipp Schafft
🦁
Browse files
Update: Make connection IDs it's own type
parent
d08eba96
Pipeline
#242
failed with stage
in 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/connection.c
View file @
73f00d59
...
...
@@ -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
++
;
...
...
src/connection.h
View file @
73f00d59
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment