Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Olivier Crête
libnice
Commits
3c29a99c
Commit
3c29a99c
authored
Nov 16, 2018
by
Olivier Crête
Committed by
Olivier Crête
Nov 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udp-turn: Create locked version of realm&nonce cache function
To be able to call it from a context that is already locked.
parent
ceef96fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
socket/udp-turn.c
socket/udp-turn.c
+13
-6
No files found.
socket/udp-turn.c
View file @
3c29a99c
...
...
@@ -1224,16 +1224,15 @@ priv_binding_timeout (gpointer data)
return
G_SOURCE_REMOVE
;
}
void
nice_udp_turn_socket_cache_realm_nonce
(
NiceSocket
*
sock
,
StunMessage
*
msg
)
static
void
nice_udp_turn_socket_cache_realm_nonce_locked
(
NiceSocket
*
sock
,
StunMessage
*
msg
)
{
UdpTurnPriv
*
priv
=
sock
->
priv
;
gconstpointer
tmp
;
g_assert
(
sock
->
type
==
NICE_SOCKET_TYPE_UDP_TURN
);
g_mutex_lock
(
&
mutex
);
g_free
(
priv
->
cached_realm
);
priv
->
cached_realm
=
NULL
;
priv
->
cached_realm_len
=
0
;
...
...
@@ -1250,6 +1249,14 @@ nice_udp_turn_socket_cache_realm_nonce (NiceSocket *sock, StunMessage *msg)
if
(
tmp
&&
priv
->
cached_nonce_len
<
764
)
priv
->
cached_nonce
=
g_memdup
(
tmp
,
priv
->
cached_nonce_len
);
}
void
nice_udp_turn_socket_cache_realm_nonce
(
NiceSocket
*
sock
,
StunMessage
*
msg
)
{
g_mutex_lock
(
&
mutex
);
nice_udp_turn_socket_cache_realm_nonce_locked
(
sock
,
msg
);
g_mutex_unlock
(
&
mutex
);
}
...
...
@@ -1454,7 +1461,7 @@ nice_udp_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
g_free
(
priv
->
current_binding_msg
);
priv
->
current_binding_msg
=
NULL
;
nice_udp_turn_socket_cache_realm_nonce
(
sock
,
&
msg
);
nice_udp_turn_socket_cache_realm_nonce
_locked
(
sock
,
&
msg
);
if
(
binding
)
priv_send_channel_bind
(
priv
,
binding
->
channel
,
&
binding
->
peer
);
...
...
@@ -1558,7 +1565,7 @@ nice_udp_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
g_free
(
current_create_permission_msg
);
current_create_permission_msg
=
NULL
;
nice_udp_turn_socket_cache_realm_nonce
(
sock
,
&
msg
);
nice_udp_turn_socket_cache_realm_nonce
_locked
(
sock
,
&
msg
);
/* resend CreatePermission */
priv_send_create_permission
(
priv
,
&
to
);
goto
done
;
...
...
Write
Preview
Markdown
is supported
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