Commit 8d87008a authored by Marcus Lundblad's avatar Marcus Lundblad Committed by Youness Alaoui

Re-arrange the code when obtaining a permission and enqueueing data

parent d6be49fd
...@@ -553,13 +553,6 @@ socket_send (NiceSocket *sock, const NiceAddress *to, ...@@ -553,13 +553,6 @@ socket_send (NiceSocket *sock, const NiceAddress *to,
} }
if (msg_len > 0) { if (msg_len > 0) {
if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766) {
if (!priv_has_permission_for_peer (priv, to) &&
!priv_has_sent_permission_for_peer (priv, to)) {
priv_send_create_permission (priv, NULL, 0, NULL, 0, to);
}
}
if (!priv->current_binding_msg && binding && !binding->active) { if (!priv->current_binding_msg && binding && !binding->active) {
nice_debug("renewing channel binding"); nice_debug("renewing channel binding");
priv_send_channel_bind (priv, NULL, binding->channel, to); priv_send_channel_bind (priv, NULL, binding->channel, to);
...@@ -567,6 +560,10 @@ socket_send (NiceSocket *sock, const NiceAddress *to, ...@@ -567,6 +560,10 @@ socket_send (NiceSocket *sock, const NiceAddress *to,
if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766 && if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766 &&
!priv_has_permission_for_peer (priv, to)) { !priv_has_permission_for_peer (priv, to)) {
if (!priv_has_sent_permission_for_peer (priv, to)) {
priv_send_create_permission (priv, NULL, 0, NULL, 0, to);
}
/* enque data */ /* enque data */
nice_debug("enqueing data to be sent when aquiring permission or binding"); nice_debug("enqueing data to be sent when aquiring permission or binding");
socket_enqueue_data(priv, to, msg_len, (gchar *)buffer); socket_enqueue_data(priv, to, msg_len, (gchar *)buffer);
......
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